OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Updates enums in histograms.xml file with values read from provided C++ enum. | 5 """Updates enums in histograms.xml file with values read from provided C++ enum. |
6 | 6 |
7 If the file was pretty-printed, the updated version is pretty-printed too. | 7 If the file was pretty-printed, the updated version is pretty-printed too. |
8 """ | 8 """ |
9 | 9 |
10 import logging | 10 import logging |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 histogram_enum_name: The name of the XML <enum> attribute to update. | 267 histogram_enum_name: The name of the XML <enum> attribute to update. |
268 source_enum_path: A unix-style path, relative to src/, giving | 268 source_enum_path: A unix-style path, relative to src/, giving |
269 the C++ header file from which to read the enum. | 269 the C++ header file from which to read the enum. |
270 start_marker: A regular expression that matches the start of the C++ enum. | 270 start_marker: A regular expression that matches the start of the C++ enum. |
271 end_marker: A regular expression that matches the end of the C++ enum. | 271 end_marker: A regular expression that matches the end of the C++ enum. |
272 strip_k_prefix: Set to True if enum values are declared as kFoo and the | 272 strip_k_prefix: Set to True if enum values are declared as kFoo and the |
273 'k' should be stripped. | 273 'k' should be stripped. |
274 """ | 274 """ |
275 | 275 |
276 Log('Reading histogram enum definition from "{0}".'.format(source_enum_path)) | 276 Log('Reading histogram enum definition from "{0}".'.format(source_enum_path)) |
277 source_enum_values, ignored = ReadHistogramValues(source_enum_path, | 277 source_enum_values = ReadHistogramValues(source_enum_path, |
278 start_marker, end_marker, strip_k_prefix) | 278 start_marker, end_marker, strip_k_prefix) |
279 | 279 |
280 UpdateHistogramFromDict(histogram_enum_name, source_enum_values, | 280 UpdateHistogramFromDict(histogram_enum_name, source_enum_values, |
281 source_enum_path) | 281 source_enum_path) |
OLD | NEW |