pyfarm.core.files module

File Operations

Low level module responsible for working with and resolving information related to file paths

pyfarm.core.files.expandenv(envvar, validate=True, pathsep=None)

Takes the environment variable given by envvar, splits it into multiple paths, then expands/validates them as requested.

Parameters:
  • validate (bool) – if True then only paths which exist will be returned
  • pathsep (str) – if provided then use this as the value to split the environment variable by, otherwise use os.pathsep
Raises:
  • exceptions.EnvironmentError – raised if the requested envvar does not exist
  • exceptions.ValueError – raised if the requested envvar does exist but does not contain any data
pyfarm.core.files.expandpath(path)

Expands environment variables and user paths such as ~ in path using os.path.expandvars() and os.path.expanduser()

pyfarm.core.files.which(program)

returns the path to the requested program

Note

This function will not resolve aliases

Raises OSError:raised if the path to the program could not be found