Exemplo n.º 1
0
def main():
    doc = merge_xml.MergeFiles(histogram_paths.ALL_XMLS)
    histograms, had_errors = extract_histograms.ExtractHistogramsFromDom(doc)
    if had_errors:
        raise Error("Error parsing inputs.")
    names = extract_histograms.ExtractNames(histograms)
    for name in names:
        print name
Exemplo n.º 2
0
def readXmlHistograms(histograms_file_location):
  """Parses all histogram names from histograms.xml.

  Returns:
    A set cotaining the parsed histogram names.
  """
  logging.info('Reading histograms from %s...' % histograms_file_location)
  histograms = extract_histograms.ExtractHistograms(histograms_file_location)
  return set(extract_histograms.ExtractNames(histograms))
Exemplo n.º 3
0
def readAllXmlHistograms():
    """Parses all histogram names defined in |histogram_paths.ALL_XMLS|.

  Returns:
    A set containing the parsed histogram names.
  """
    merged = merge_xml.MergeFiles(histogram_paths.ALL_XMLS)
    histograms, _ = extract_histograms.ExtractHistogramsFromDom(merged)
    return set(extract_histograms.ExtractNames(histograms))
Exemplo n.º 4
0
def get_names(xml_files):
    """Returns all histogram names generated from a list of xml files.

  Args:
    xml_files: A list of open file objects containing histogram definitions.
  Returns:
    A tuple of (names, obsolete names), where the obsolete names is a subset of
    all names.
  """
    doc = merge_xml.MergeFiles(files=xml_files)
    histograms, had_errors = extract_histograms.ExtractHistogramsFromDom(doc)
    if had_errors:
        raise ValueError("Error parsing inputs.")
    names = set(extract_histograms.ExtractNames(histograms))
    obsolete_names = set(extract_histograms.ExtractObsoleteNames(histograms))
    return (names, obsolete_names)
Exemplo n.º 5
0
def get_names(xml_files):
    doc = merge_xml.MergeFiles(files=xml_files)
    histograms, had_errors = extract_histograms.ExtractHistogramsFromDom(doc)
    if had_errors:
        raise Error("Error parsing inputs.")
    return extract_histograms.ExtractNames(histograms)