tools/android/modularization/owners/getowners.py
def _build_owners_info(chromium_root: str,
                       owners_filepath: str) -> owners_data.Owners:
  '''Creates a synthetic representation of an OWNERS file.'''

  if not owners_filepath: return None

  assert owners_filepath.startswith(os.path.join(chromium_root, ''))
  owners_file = owners_filepath[len(chromium_root) + 1:]
  if owners_file in owners_map:
    return owners_map[owners_file]

  owners = owners_data.Owners(owners_file)

  with open(owners_filepath, 'r') as f:
    for line in f:
      line = line.strip()
      if not line:
        continue
      elif line.startswith('file://'):
        owners.file_inherited = line[len('file://'):].strip()
      elif line.startswith('#'):
        continue
      elif line.startswith('per-file'):
        continue
      elif '@' in line:
        # Remove comments after the email
        owner_email = line.split(' ', 1)[0]
        owners.owners.append(line)

    owners_map[owners.owners_file] = owners

    _propagate_down_owner_variables(chromium_root, owners)

    return owners
Creates a synthetic representation of an OWNERS file.
Creates a synthetic representation of an OWNERS file.
Creates a synthetic representation of an OWNERS file .
def _build_owners_info(chromium_root: str,
                       owners_filepath: str) -> owners_data.Owners:
  if not owners_filepath: return None
  assert owners_filepath.startswith(os.path.join(chromium_root, ''))
  owners_file = owners_filepath[len(chromium_root) + 1:]
  if owners_file in owners_map:
    return owners_map[owners_file]
  owners = owners_data.Owners(owners_file)
  with open(owners_filepath, 'r') as f:
    for line in f:
      line = line.strip()
      if not line:
        continue
      elif line.startswith('file://'):
        owners.file_inherited = line[len('file://'):].strip()
      elif line.startswith('#'):
        continue
      elif line.startswith('per-file'):
        continue
      elif '@' in line:
        owner_email = line.split(' ', 1)[0]
        owners.owners.append(line)
    owners_map[owners.owners_file] = owners
    _propagate_down_owner_variables(chromium_root, owners)
    return owners
def _build_owners_info ( chromium_root : str , owners_filepath : str ) -> owners_data . Owners : if not owners_filepath : return None assert owners_filepath . startswith ( os . path . join ( chromium_root , '' ) ) owners_file = owners_filepath [ len ( chromium_root ) + 1 : ] if owners_file in owners_map : return owners_map [ owners_file ] owners = owners_data . Owners ( owners_file ) with open ( owners_filepath , 'r' ) as f : for line in f : line = line . strip ( ) if not line : continue elif line . startswith ( 'file://' ) : owners . file_inherited = line [ len ( 'file://' ) : ] . strip ( ) elif line . startswith ( '#' ) : continue elif line . startswith ( 'per-file' ) : continue elif '@' in line : owner_email = line . split ( ' ' , 1 ) [ 0 ] owners . owners . append ( line ) owners_map [ owners . owners_file ] = owners _propagate_down_owner_variables ( chromium_root , owners ) return owners
Creates a synthetic representation of an OWNERS file.
Creates a synthetic representation of an OWNERS file .
'''Creates a synthetic representation of an OWNERS file.''' # Remove comments after the email
chromium_root
str
owners_filepath
str