tools/android/modularization/owners/getowners.py
def _find_owners_file(chromium_root: str, filepath: str) -> str:
  '''Returns the path to the OWNERS file for the given path (or up the tree).'''

  if not filepath.startswith(os.path.join(chromium_root, '')):
    filepath = os.path.join(chromium_root, filepath)

  if os.path.isdir(filepath):
    ofile = os.path.join(filepath, 'OWNERS')
  else:
    if 'OWNERS' in os.path.basename(filepath):
      ofile = filepath
    else:
      filepath = os.path.dirname(filepath)
      ofile = os.path.join(filepath, 'OWNERS')

  if os.path.exists(ofile):
    return ofile
  else:
    return _find_owners_file(chromium_root, os.path.dirname(filepath))
Returns the path to the OWNERS file for the given path (or up the tree).
Returns the path to the OWNERS file for the given path (or up the tree).
Returns the path to the OWNERS file for the given path ( or up the tree ) .
def _find_owners_file(chromium_root: str, filepath: str) -> str:
  if not filepath.startswith(os.path.join(chromium_root, '')):
    filepath = os.path.join(chromium_root, filepath)
  if os.path.isdir(filepath):
    ofile = os.path.join(filepath, 'OWNERS')
  else:
    if 'OWNERS' in os.path.basename(filepath):
      ofile = filepath
    else:
      filepath = os.path.dirname(filepath)
      ofile = os.path.join(filepath, 'OWNERS')
  if os.path.exists(ofile):
    return ofile
  else:
    return _find_owners_file(chromium_root, os.path.dirname(filepath))
def _find_owners_file ( chromium_root : str , filepath : str ) -> str : if not filepath . startswith ( os . path . join ( chromium_root , '' ) ) : filepath = os . path . join ( chromium_root , filepath ) if os . path . isdir ( filepath ) : ofile = os . path . join ( filepath , 'OWNERS' ) else : if 'OWNERS' in os . path . basename ( filepath ) : ofile = filepath else : filepath = os . path . dirname ( filepath ) ofile = os . path . join ( filepath , 'OWNERS' ) if os . path . exists ( ofile ) : return ofile else : return _find_owners_file ( chromium_root , os . path . dirname ( filepath ) )
Returns the path to the OWNERS file for the given path (or up the tree).
Returns the path to the OWNERS file for the given path ( or up the tree ) .
'''Returns the path to the OWNERS file for the given path (or up the tree).'''
chromium_root
str
filepath
str