tools/binary_size/libsupersize/dir_metadata.py
def _ComponentForDirectory(self, directory):
    """Searches all parent directories for COMPONENT in OWNERS files.

    Args:
      directory: Path of directory to start searching from relative to
        |source_directory|.

    Returns:
      COMPONENT belonging to |path|, or empty string if not found.
    """
    assert not os.path.isabs(directory)
    component = self._dir_cache.get(directory)
    if component is not None:
      return component

    metadata_path = os.path.join(self._source_directory, directory,
                                 _METADATA_FILENAME)
    result = self._ParseComponentFromMetadata(metadata_path)

    if not result:
      parent_directory = os.path.dirname(directory)
      if parent_directory:
        result = self._ComponentForDirectory(parent_directory)

    self._dir_cache[directory] = result
    return result
Searches all parent directories for COMPONENT in OWNERS files.

    Args:
      directory: Path of directory to start searching from relative to
        |source_directory|.

    Returns:
      COMPONENT belonging to |path|, or empty string if not found.
    
Searches all parent directories for COMPONENT in OWNERS files.
Searches all parent directories for COMPONENT in OWNERS files .
def _ComponentForDirectory(self, directory):
    assert not os.path.isabs(directory)
    component = self._dir_cache.get(directory)
    if component is not None:
      return component
    metadata_path = os.path.join(self._source_directory, directory,
                                 _METADATA_FILENAME)
    result = self._ParseComponentFromMetadata(metadata_path)
    if not result:
      parent_directory = os.path.dirname(directory)
      if parent_directory:
        result = self._ComponentForDirectory(parent_directory)
    self._dir_cache[directory] = result
    return result
def _ComponentForDirectory ( self , directory ) : assert not os . path . isabs ( directory ) component = self . _dir_cache . get ( directory ) if component is not None : return component metadata_path = os . path . join ( self . _source_directory , directory , _METADATA_FILENAME ) result = self . _ParseComponentFromMetadata ( metadata_path ) if not result : parent_directory = os . path . dirname ( directory ) if parent_directory : result = self . _ComponentForDirectory ( parent_directory ) self . _dir_cache [ directory ] = result return result
Searches all parent directories for COMPONENT in OWNERS files.
Searches all parent directories for COMPONENT in OWNERS files .
"""Searches all parent directories for COMPONENT in OWNERS files.

    Args:
      directory: Path of directory to start searching from relative to
        |source_directory|.

    Returns:
      COMPONENT belonging to |path|, or empty string if not found.
    """
COMPONENT belonging to |path|, or empty string if not found.
COMPONENT belonging to |path| or empty string if not found .
self
directory
Path of directory to start searching from relative to
|source_directory|.
Path of directory to start searching from relative to |source_directory| .