tools/metrics/histograms/generate_expired_histograms_array.py
def _GenerateFileContent(descriptions, branch_file_content,
                         mstone_file_content, header_filename, namespace):
  """Generates header file containing array with hashes of expired histograms.

  Args:
    descriptions: Combined histogram descriptions.
    branch_file_content: Content of file with base date.
    mstone_file_content: Content of file with milestone information.
    header_filename: A filename of the generated header file.
    namespace: A namespace to contain generated array.

  Raises:
    Error if there is an error in input xml files.
  """
  histograms, had_errors = (
      extract_histograms.ExtractHistogramsFromDom(descriptions))
  if had_errors:
    raise Error("Error parsing inputs.")
  base_date = _GetBaseDate(branch_file_content, _DATE_FILE_RE)
  base_date -= datetime.timedelta(weeks=_EXPIRE_GRACE_WEEKS)
  current_milestone = _GetCurrentMilestone(
      mstone_file_content, _CURRENT_MILESTONE_RE)
  current_milestone -= _EXPIRE_GRACE_MSTONES

  expired_histograms_names = _GetExpiredHistograms(
      histograms, base_date, current_milestone)
  expired_histograms_map = _GetHashToNameMap(expired_histograms_names)
  header_file_content = _GenerateHeaderFileContent(
      header_filename, namespace, expired_histograms_map)
  return header_file_content
Generates header file containing array with hashes of expired histograms.

  Args:
    descriptions: Combined histogram descriptions.
    branch_file_content: Content of file with base date.
    mstone_file_content: Content of file with milestone information.
    header_filename: A filename of the generated header file.
    namespace: A namespace to contain generated array.

  Raises:
    Error if there is an error in input xml files.
  
Generates header file containing array with hashes of expired histograms.
Args:
descriptions: Combined histogram descriptions.
branch_file_content: Content of file with base date.
mstone_file_content: Content of file with milestone information.
header_filename: A filename of the generated header file.
namespace: A namespace to contain generated array.

Error if there is an error in input xml files.
Generates header file containing array with hashes of expired histograms . Args : descriptions : Combined histogram descriptions . branch_file_content : Content of file with base date . mstone_file_content : Content of file with milestone information . header_filename : A filename of the generated header file . namespace : A namespace to contain generated array . Error if there is an error in input xml files .
def _GenerateFileContent(descriptions, branch_file_content,
                         mstone_file_content, header_filename, namespace):
  histograms, had_errors = (
      extract_histograms.ExtractHistogramsFromDom(descriptions))
  if had_errors:
    raise Error("Error parsing inputs.")
  base_date = _GetBaseDate(branch_file_content, _DATE_FILE_RE)
  base_date -= datetime.timedelta(weeks=_EXPIRE_GRACE_WEEKS)
  current_milestone = _GetCurrentMilestone(
      mstone_file_content, _CURRENT_MILESTONE_RE)
  current_milestone -= _EXPIRE_GRACE_MSTONES
  expired_histograms_names = _GetExpiredHistograms(
      histograms, base_date, current_milestone)
  expired_histograms_map = _GetHashToNameMap(expired_histograms_names)
  header_file_content = _GenerateHeaderFileContent(
      header_filename, namespace, expired_histograms_map)
  return header_file_content
def _GenerateFileContent ( descriptions , branch_file_content , mstone_file_content , header_filename , namespace ) : histograms , had_errors = ( extract_histograms . ExtractHistogramsFromDom ( descriptions ) ) if had_errors : raise Error ( "Error parsing inputs." ) base_date = _GetBaseDate ( branch_file_content , _DATE_FILE_RE ) base_date -= datetime . timedelta ( weeks = _EXPIRE_GRACE_WEEKS ) current_milestone = _GetCurrentMilestone ( mstone_file_content , _CURRENT_MILESTONE_RE ) current_milestone -= _EXPIRE_GRACE_MSTONES expired_histograms_names = _GetExpiredHistograms ( histograms , base_date , current_milestone ) expired_histograms_map = _GetHashToNameMap ( expired_histograms_names ) header_file_content = _GenerateHeaderFileContent ( header_filename , namespace , expired_histograms_map ) return 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:
    descriptions: Combined histogram descriptions.
    branch_file_content: Content of file with base date.
    mstone_file_content: Content of file with milestone information.
    header_filename: A filename of the generated header file.
    namespace: A namespace to contain generated array.

  Raises:
    Error if there is an error in input xml files.
  """
descriptions
branch_file_content
mstone_file_content
header_filename
namespace