A set of tools for managing paths.
The path_tools module provides auxiliary methods for converting between different path names. It’s main function is to convert path names indicated relative to the Transport directory to absolute path names.
Takes a nested list and returns a flattened list. The output is always a single-level list, and the input can be a tuple, a list, a string, an uncombined sequence of strings, or any nested combination of these.
Parameters : | nested : sequence
|
---|---|
Returns : | list :
|
Expand a relative path into an absolute path.
Merges the components in args (which may be a list, a tuple, or simply a comma-separated series) and assembles a full path, assuming they are paths relative to the project root.
Parameters : | args : sequence
|
---|---|
Returns : | str :
|
Convert an absolute path to one relative to the project home.
Parameters : | path : str
asList : bool
|
---|---|
Returns : | str or list(str) :
|
Convert a path to a string suitable for importing.
Parameters : | path : str
isRelative : bool
importItem : str
importFrom : bool
|
---|---|
Returns : | tuple (str, str) :
|
Replace all backslashes with front-slashes.
Parameters : | path : str
|
---|---|
Returns : | str :
|
Return the path split into its components.
Parameters : | path : str
|
---|---|
Returns : | list of str :
|
List the contents of a directory specified by an absolute path.
Parameters : | directory : str
filesOnly : bool
|
---|---|
Returns : | list of str :
|
List the contents of a directory specified relative to the project home.
Parameters : | directory : str
filesOnly : bool
|
---|---|
Returns : | list(str) :
|
Determine the next scan number.
Determine the next unused scan number, assuming that scans are indicated by ‘sNNN’ or ‘sNNNN’, where N is a digit.
Parameters : | directory : str
|
---|---|
Returns : | str :
|
Append digits to avoid filename clashes.
Append incrementally larger digits to the name of a file until the name does not collide with existing files.
Parameters : | folder : str
basename : str
extension : str
|
---|---|
Returns : | str :
|
Return a dictionary containing data about postprocessor scripts.
Returns : | dict :
|
---|