tools/metrics/histograms/suffixes_to_variants.py
def _MigrateOutOfLineVariants(doc, histograms, suffixes_to_convert):
  """Converts a histogram-suffixes node to an out-of-line variants."""
  histograms_node = histograms.getElementsByTagName('histograms')
  assert len(histograms_node) == 1, (
      'Every histograms.xml should have only one <histograms> node.')
  for suffixes in suffixes_to_convert:
    histogram_suffixes_name = suffixes.getAttribute('name')
    variants = doc.createElement('variants')
    variants.setAttribute('name', histogram_suffixes_name)
    if not _PopulateVariantsWithSuffixes(doc, variants, suffixes):
      logging.warning('histogram_suffixes: %s needs manually effort',
                      histogram_suffixes_name)
    else:
      histograms_node[0].appendChild(variants)
      suffixes.parentNode.removeChild(suffixes)
Converts a histogram-suffixes node to an out-of-line variants.
Converts a histogram-suffixes node to an out-of-line variants.
Converts a histogram - suffixes node to an out - of - line variants .
def _MigrateOutOfLineVariants(doc, histograms, suffixes_to_convert):
  histograms_node = histograms.getElementsByTagName('histograms')
  assert len(histograms_node) == 1, (
      'Every histograms.xml should have only one <histograms> node.')
  for suffixes in suffixes_to_convert:
    histogram_suffixes_name = suffixes.getAttribute('name')
    variants = doc.createElement('variants')
    variants.setAttribute('name', histogram_suffixes_name)
    if not _PopulateVariantsWithSuffixes(doc, variants, suffixes):
      logging.warning('histogram_suffixes: %s needs manually effort',
                      histogram_suffixes_name)
    else:
      histograms_node[0].appendChild(variants)
      suffixes.parentNode.removeChild(suffixes)
def _MigrateOutOfLineVariants ( doc , histograms , suffixes_to_convert ) : histograms_node = histograms . getElementsByTagName ( 'histograms' ) assert len ( histograms_node ) == 1 , ( 'Every histograms.xml should have only one <histograms> node.' ) for suffixes in suffixes_to_convert : histogram_suffixes_name = suffixes . getAttribute ( 'name' ) variants = doc . createElement ( 'variants' ) variants . setAttribute ( 'name' , histogram_suffixes_name ) if not _PopulateVariantsWithSuffixes ( doc , variants , suffixes ) : logging . warning ( 'histogram_suffixes: %s needs manually effort' , histogram_suffixes_name ) else : histograms_node [ 0 ] . appendChild ( variants ) suffixes . parentNode . removeChild ( suffixes )
Converts a histogram-suffixes node to an out-of-line variants.
Converts a histogram - suffixes node to an out - of - line variants .
"""Converts a histogram-suffixes node to an out-of-line variants."""
doc
histograms
suffixes_to_convert