tools/android/modularization/owners/owners_exporter.py
def _to_data_dict(requested_path: owners_data.RequestedPath,
                  path_data: owners_data.PathData) -> Dict:
  '''Transforms the RequestPath into a flat dictionary to be converted to json.
  '''

  def _joinppl(ppl, include_count=False):
    r = []
    for p in ppl:
      r.append(p[0] if not include_count else '{} ({})'.format(p[0], p[1]))
    return r

  owners = path_data.owner
  dir_metadata = path_data.dir_metadata
  git_data = path_data.git_data

  return {
      'path': requested_path.path,
      'feature': requested_path.feature,
      'owners_file': owners.owners_file,
      'owners_email': ', '.join(owners.owners),
      'team': dir_metadata.team if dir_metadata.team else '',
      'component': dir_metadata.component if dir_metadata.component else '',
      'os': dir_metadata.os if dir_metadata.os else '',
      'lines_of_code': str(git_data.lines_of_code),
      'number_of_files': str(git_data.number_of_files),
      'latest_cl_date': git_data.latest_cl_date,
      'cl_count': str(git_data.cls),
      'reverted_cl_count': str(git_data.reverted_cls),
      'relanded_cl_count': str(git_data.relanded_cls),
      'top_authors': ', '.join(_joinppl(git_data.get_top_authors(3))),
      'top_reviewers': ', '.join(_joinppl(git_data.get_top_reviewers(3))),
      'git_head': git_data.git_head,
      'git_head_time': git_data.git_head_time,
  }
Transforms the RequestPath into a flat dictionary to be converted to json.
  
Transforms the RequestPath into a flat dictionary to be converted to json.
Transforms the RequestPath into a flat dictionary to be converted to json .
def _to_data_dict(requested_path: owners_data.RequestedPath,
                  path_data: owners_data.PathData) -> Dict:
  def _joinppl(ppl, include_count=False):
    r = []
    for p in ppl:
      r.append(p[0] if not include_count else '{} ({})'.format(p[0], p[1]))
    return r
  owners = path_data.owner
  dir_metadata = path_data.dir_metadata
  git_data = path_data.git_data
  return {
      'path': requested_path.path,
      'feature': requested_path.feature,
      'owners_file': owners.owners_file,
      'owners_email': ', '.join(owners.owners),
      'team': dir_metadata.team if dir_metadata.team else '',
      'component': dir_metadata.component if dir_metadata.component else '',
      'os': dir_metadata.os if dir_metadata.os else '',
      'lines_of_code': str(git_data.lines_of_code),
      'number_of_files': str(git_data.number_of_files),
      'latest_cl_date': git_data.latest_cl_date,
      'cl_count': str(git_data.cls),
      'reverted_cl_count': str(git_data.reverted_cls),
      'relanded_cl_count': str(git_data.relanded_cls),
      'top_authors': ', '.join(_joinppl(git_data.get_top_authors(3))),
      'top_reviewers': ', '.join(_joinppl(git_data.get_top_reviewers(3))),
      'git_head': git_data.git_head,
      'git_head_time': git_data.git_head_time,
  }
def _to_data_dict ( requested_path : owners_data . RequestedPath , path_data : owners_data . PathData ) -> Dict : def _joinppl ( ppl , include_count = False ) : r = [ ] for p in ppl : r . append ( p [ 0 ] if not include_count else '{} ({})' . format ( p [ 0 ] , p [ 1 ] ) ) return r owners = path_data . owner dir_metadata = path_data . dir_metadata git_data = path_data . git_data return { 'path' : requested_path . path , 'feature' : requested_path . feature , 'owners_file' : owners . owners_file , 'owners_email' : ', ' . join ( owners . owners ) , 'team' : dir_metadata . team if dir_metadata . team else '' , 'component' : dir_metadata . component if dir_metadata . component else '' , 'os' : dir_metadata . os if dir_metadata . os else '' , 'lines_of_code' : str ( git_data . lines_of_code ) , 'number_of_files' : str ( git_data . number_of_files ) , 'latest_cl_date' : git_data . latest_cl_date , 'cl_count' : str ( git_data . cls ) , 'reverted_cl_count' : str ( git_data . reverted_cls ) , 'relanded_cl_count' : str ( git_data . relanded_cls ) , 'top_authors' : ', ' . join ( _joinppl ( git_data . get_top_authors ( 3 ) ) ) , 'top_reviewers' : ', ' . join ( _joinppl ( git_data . get_top_reviewers ( 3 ) ) ) , 'git_head' : git_data . git_head , 'git_head_time' : git_data . git_head_time , }
Transforms the RequestPath into a flat dictionary to be converted to json.
Transforms the RequestPath into a flat dictionary to be converted to json .
'''Transforms the RequestPath into a flat dictionary to be converted to json.
  '''
requested_path
owners_data.RequestedPath
path_data
owners_data.PathData