module documentation

File and path utilities.

Function cd Context manager. Change the directory, and restore it afterwards.
Function expand_globpaths Expand a list of glob expressions into a list of full paths.
Function expand_path Fully expand a path, optionally with an explicit cwd.
Function expand_paths Fully expand a list of paths, optionally with an explicit cwd.
Function expand_pythonpath Expand a/b:c/d into [/path/to/a/b, /path/to/c/d].
Function expand_source_files Expand a space-separated string of filenames passed in as sources.
Function is_pickle Checks if the filename is a pickle file.
Function is_pyi_directory_init Checks if a pyi file is path/to/dir/__init__.pyi.
Function makedirs Create a nested directory, but don't fail if any of it already exists.
Function recursive_glob Call recursive glob iff ** is in the pattern.
Function replace_extension Undocumented
Function replace_separator replace `/` with `os.path.sep`, replace `:` with `os.pathsep`.
Constant PICKLE_EXT Undocumented

Context manager. Change the directory, and restore it afterwards. Example usage: with cd("/path"): ... Arguments: path: The directory to change to. If empty, this function is a no-op. Yields: Executes your code, in a changed directory.

def expand_globpaths(globpaths, cwd=None): (source)

Expand a list of glob expressions into a list of full paths.

def expand_path(path, cwd=None): (source)

Fully expand a path, optionally with an explicit cwd.

def expand_paths(paths, cwd=None): (source)

Fully expand a list of paths, optionally with an explicit cwd.

def expand_pythonpath(pythonpath, cwd=None): (source)

Expand a/b:c/d into [/path/to/a/b, /path/to/c/d].

def expand_source_files(filenames, cwd=None): (source)

Expand a space-separated string of filenames passed in as sources. This is a helper function for handling command line arguments that specify a list of source files and directories. Any directories in filenames will be scanned recursively for .py files. Any files that do not end with ".py" will be dropped. Args: filenames: A space-separated string of filenames to process. cwd: An optional working directory to expand relative paths Returns: A set of full paths to .py files

def is_pickle(filename): (source)

Checks if the filename is a pickle file.

def is_pyi_directory_init(filename): (source)

Checks if a pyi file is path/to/dir/__init__.pyi.

def makedirs(path): (source)

Create a nested directory, but don't fail if any of it already exists.

def recursive_glob(path): (source)

Call recursive glob iff ** is in the pattern.

def replace_extension(filename, new_extension): (source)

Undocumented

def replace_separator(path: str): (source)

replace `/` with `os.path.sep`, replace `:` with `os.pathsep`.

PICKLE_EXT: str = (source)

Undocumented

Value
'.pickled'