tools/metrics/histograms/update_histogram_enum.py
def UpdateHistogramEnumFromXML(histogram_enum_name, source_enum_path,
                               caller_script_name, element_name,
                               value_attribute, label_attribute):
  """Reads a .xml file and updates histograms.xml to match.

  Args:
      histogram_enum_name: The name of the XML <enum> attribute to update.
      source_enum_path: A unix-style path, relative to src/, giving
          the XML file from which to read the enum.
      caller_script_name: Name of the script calling this function.
      element_name: Name of elements in the given XML that would be used to
          extract enums.
      value_attribute: The attribute name in source XML that would be mapped to
          |value| attributes in enums.xml.
      label_attribute: The attribute name in source XML that would be mapped to
          |label| attributes in enums.xml.
  """

  Log('Reading histogram enum definition from "{0}".'.format(source_enum_path))
  source_enum_values = ReadHistogramValuesFromXML(
      source_enum_path, element_name, value_attribute, label_attribute)

  UpdateHistogramFromDict(histogram_enum_name, source_enum_values,
      source_enum_path, caller_script_name)
Reads a .xml file and updates histograms.xml to match.

  Args:
      histogram_enum_name: The name of the XML <enum> attribute to update.
      source_enum_path: A unix-style path, relative to src/, giving
          the XML file from which to read the enum.
      caller_script_name: Name of the script calling this function.
      element_name: Name of elements in the given XML that would be used to
          extract enums.
      value_attribute: The attribute name in source XML that would be mapped to
          |value| attributes in enums.xml.
      label_attribute: The attribute name in source XML that would be mapped to
          |label| attributes in enums.xml.
  
Reads a .xml file and updates histograms.xml to match.
Reads a . xml file and updates histograms . xml to match .
def UpdateHistogramEnumFromXML(histogram_enum_name, source_enum_path,
                               caller_script_name, element_name,
                               value_attribute, label_attribute):
  Log('Reading histogram enum definition from "{0}".'.format(source_enum_path))
  source_enum_values = ReadHistogramValuesFromXML(
      source_enum_path, element_name, value_attribute, label_attribute)
  UpdateHistogramFromDict(histogram_enum_name, source_enum_values,
      source_enum_path, caller_script_name)
def UpdateHistogramEnumFromXML ( histogram_enum_name , source_enum_path , caller_script_name , element_name , value_attribute , label_attribute ) : Log ( 'Reading histogram enum definition from "{0}".' . format ( source_enum_path ) ) source_enum_values = ReadHistogramValuesFromXML ( source_enum_path , element_name , value_attribute , label_attribute ) UpdateHistogramFromDict ( histogram_enum_name , source_enum_values , source_enum_path , caller_script_name )
Reads a .xml file and updates histograms.xml to match.
Reads a . xml file and updates histograms . xml to match .
"""Reads a .xml file and updates histograms.xml to match.

  Args:
      histogram_enum_name: The name of the XML <enum> attribute to update.
      source_enum_path: A unix-style path, relative to src/, giving
          the XML file from which to read the enum.
      caller_script_name: Name of the script calling this function.
      element_name: Name of elements in the given XML that would be used to
          extract enums.
      value_attribute: The attribute name in source XML that would be mapped to
          |value| attributes in enums.xml.
      label_attribute: The attribute name in source XML that would be mapped to
          |label| attributes in enums.xml.
  """
histogram_enum_name
The name of the XML  attribute to update.
The name of the XML attribute to update .
source_enum_path
A unix-style path, relative to src/, giving
the XML file from which to read the enum.
A unix - style path relative to src / giving the XML file from which to read the enum .
caller_script_name
Name of the script calling this function.
Name of the script calling this function .
element_name
Name of elements in the given XML that would be used to
extract enums.
Name of elements in the given XML that would be used to extract enums .
value_attribute
The attribute name in source XML that would be mapped to
|value| attributes in enums.xml.
The attribute name in source XML that would be mapped to |value| attributes in enums . xml .
label_attribute
The attribute name in source XML that would be mapped to
|label| attributes in enums.xml.
The attribute name in source XML that would be mapped to |label| attributes in enums . xml .