third_party/google-closure-library/closure/bin/build/depswriter.py
def _GetRelativePathToSourceDict(root, prefix=''):
  """Scans a top root directory for .js sources.

  Args:
    root: str, Root directory.
    prefix: str, Prefix for returned paths.

  Returns:
    dict, A map of relative paths (with prefix, if given), to source.Source
      objects.
  """
  # Remember and restore the cwd when we're done. We work from the root so
  # that paths are relative from the root.
  start_wd = os.getcwd()
  os.chdir(root)

  path_to_source = {}
  for path in treescan.ScanTreeForJsFiles('.'):
    prefixed_path = _NormalizePathSeparators(os.path.join(prefix, path))
    path_to_source[prefixed_path] = source.Source(source.GetFileContents(path))

  os.chdir(start_wd)

  return path_to_source
Scans a top root directory for .js sources.

  Args:
    root: str, Root directory.
    prefix: str, Prefix for returned paths.

  Returns:
    dict, A map of relative paths (with prefix, if given), to source.Source
      objects.
  
Scans a top root directory for .js sources.
Scans a top root directory for . js sources .
def _GetRelativePathToSourceDict(root, prefix=''):
  start_wd = os.getcwd()
  os.chdir(root)
  path_to_source = {}
  for path in treescan.ScanTreeForJsFiles('.'):
    prefixed_path = _NormalizePathSeparators(os.path.join(prefix, path))
    path_to_source[prefixed_path] = source.Source(source.GetFileContents(path))
  os.chdir(start_wd)
  return path_to_source
def _GetRelativePathToSourceDict ( root , prefix = '' ) : start_wd = os . getcwd ( ) os . chdir ( root ) path_to_source = { } for path in treescan . ScanTreeForJsFiles ( '.' ) : prefixed_path = _NormalizePathSeparators ( os . path . join ( prefix , path ) ) path_to_source [ prefixed_path ] = source . Source ( source . GetFileContents ( path ) ) os . chdir ( start_wd ) return path_to_source
Scans a top root directory for .js sources.
Scans a top root directory for . js sources .
"""Scans a top root directory for .js sources.

  Args:
    root: str, Root directory.
    prefix: str, Prefix for returned paths.

  Returns:
    dict, A map of relative paths (with prefix, if given), to source.Source
      objects.
  """ # Remember and restore the cwd when we're done. We work from the root so # that paths are relative from the root.
dict, A map of relative paths (with prefix, if given), to source.Source
objects.
dict A map of relative paths ( with prefix if given ) to source . Source objects .
root
str, Root directory.
str Root directory .
prefix
str, Prefix for returned paths.
str Prefix for returned paths .