tools/metrics/histograms/generate_expired_histograms_array.py
def _GenerateFile(arguments):
  """Generates header file containing array with hashes of expired histograms.

  Args:
    arguments: An object with the following attributes:
      arguments.inputs: A list of xml files with histogram descriptions.
      arguments.header_filename: A filename of the generated header file.
      arguments.namespace: A namespace to contain generated array.
      arguments.output_dir: A directory to put the generated file.
      arguments.major_branch_date_filepath: File path for base date.
      arguments.milestone_filepath: File path for milestone information.
  """
  # Assert that the |--inputs| is the same as |histogram_paths.ALL_XMLS| to make
  # sure we have the most updated list of histogram descriptions. Otherwise,
  # inform the cl owner to update the --inputs.
  to_add, to_remove = CheckUnsyncedHistograms(arguments.inputs)
  assert len(to_add) == 0 and len(to_remove) == 0, (
      "The --inputs is not in sync with the most updated list of xmls. Please "
      "update the inputs in "
      "components/metrics/generate_expired_histograms_array.gni.\n"
      "  add: %s\n  remove: %s" % (', '.join(to_add), ', '.join(to_remove)))

  descriptions = merge_xml.MergeFiles(arguments.inputs)
  with open(arguments.major_branch_date_filepath, "r") as date_file:
    branch_file_content = date_file.read()
  with open(arguments.milestone_filepath, "r") as milestone_file:
    mstone_file_content = milestone_file.read()

  header_file_content = _GenerateFileContent(
      descriptions, branch_file_content, mstone_file_content,
      arguments.header_filename, arguments.namespace)

  with open(os.path.join(arguments.output_dir, arguments.header_filename),
            "w") as generated_file:
    generated_file.write(header_file_content)
Generates header file containing array with hashes of expired histograms.

  Args:
    arguments: An object with the following attributes:
      arguments.inputs: A list of xml files with histogram descriptions.
      arguments.header_filename: A filename of the generated header file.
      arguments.namespace: A namespace to contain generated array.
      arguments.output_dir: A directory to put the generated file.
      arguments.major_branch_date_filepath: File path for base date.
      arguments.milestone_filepath: File path for milestone information.
  
Generates header file containing array with hashes of expired histograms.
Generates header file containing array with hashes of expired histograms .
def _GenerateFile(arguments):
  to_add, to_remove = CheckUnsyncedHistograms(arguments.inputs)
  assert len(to_add) == 0 and len(to_remove) == 0, (
      "The --inputs is not in sync with the most updated list of xmls. Please "
      "update the inputs in "
      "components/metrics/generate_expired_histograms_array.gni.\n"
      "  add: %s\n  remove: %s" % (', '.join(to_add), ', '.join(to_remove)))
  descriptions = merge_xml.MergeFiles(arguments.inputs)
  with open(arguments.major_branch_date_filepath, "r") as date_file:
    branch_file_content = date_file.read()
  with open(arguments.milestone_filepath, "r") as milestone_file:
    mstone_file_content = milestone_file.read()
  header_file_content = _GenerateFileContent(
      descriptions, branch_file_content, mstone_file_content,
      arguments.header_filename, arguments.namespace)
  with open(os.path.join(arguments.output_dir, arguments.header_filename),
            "w") as generated_file:
    generated_file.write(header_file_content)
def _GenerateFile ( arguments ) : to_add , to_remove = CheckUnsyncedHistograms ( arguments . inputs ) assert len ( to_add ) == 0 and len ( to_remove ) == 0 , ( "The --inputs is not in sync with the most updated list of xmls. Please " "update the inputs in " "components/metrics/generate_expired_histograms_array.gni.\n" "  add: %s\n  remove: %s" % ( ', ' . join ( to_add ) , ', ' . join ( to_remove ) ) ) descriptions = merge_xml . MergeFiles ( arguments . inputs ) with open ( arguments . major_branch_date_filepath , "r" ) as date_file : branch_file_content = date_file . read ( ) with open ( arguments . milestone_filepath , "r" ) as milestone_file : mstone_file_content = milestone_file . read ( ) header_file_content = _GenerateFileContent ( descriptions , branch_file_content , mstone_file_content , arguments . header_filename , arguments . namespace ) with open ( os . path . join ( arguments . output_dir , arguments . header_filename ) , "w" ) as generated_file : generated_file . write ( header_file_content )
Generates header file containing array with hashes of expired histograms.
Generates header file containing array with hashes of expired histograms .
"""Generates header file containing array with hashes of expired histograms.

  Args:
    arguments: An object with the following attributes:
      arguments.inputs: A list of xml files with histogram descriptions.
      arguments.header_filename: A filename of the generated header file.
      arguments.namespace: A namespace to contain generated array.
      arguments.output_dir: A directory to put the generated file.
      arguments.major_branch_date_filepath: File path for base date.
      arguments.milestone_filepath: File path for milestone information.
  """ # Assert that the |--inputs| is the same as |histogram_paths.ALL_XMLS| to make # sure we have the most updated list of histogram descriptions. Otherwise, # inform the cl owner to update the --inputs.
arguments
An object with the following attributes:
arguments.inputs: A list of xml files with histogram descriptions.
arguments.header_filename: A filename of the generated header file.
arguments.namespace: A namespace to contain generated array.
arguments.output_dir: A directory to put the generated file.
arguments.major_branch_date_filepath: File path for base date.
arguments.milestone_filepath: File path for milestone information.
An object with the following attributes : arguments . inputs : A list of xml files with histogram descriptions . arguments . header_filename : A filename of the generated header file . arguments . namespace : A namespace to contain generated array . arguments . output_dir : A directory to put the generated file . arguments . major_branch_date_filepath : File path for base date . arguments . milestone_filepath : File path for milestone information .