Home | Trees | Indices | Help |
---|
|
Operations with environment, file system and external commands.
Author: Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net>
License: GPLv3
Functions | |||
[string...] |
|
||
|
|||
|
|||
|
|||
string or None
|
|
||
int |
|
||
|
|||
(string, string, int) |
|
||
[string...] |
|
||
string |
|
||
unicode string or list of objects |
|
||
raw string or list of objects |
|
||
[string...] |
|
||
int |
|
||
(string)->bool |
|
||
[string...] or ([string...], (string)->bool) |
|
||
[string...] or ([string...], (string)->bool) |
|
||
string |
|
||
string |
|
Variables | |
__package__ =
|
Function Details |
Collect list of files from given directory and file paths.
Only selected files may be collected by supplying a selection function
through
|
Collect list of files having given extension from given paths. The Other parameters behave in the same way as in collect_files.
See Also: collect_files |
Collect list of catalog file paths from given paths. Applies |
Collect list of catalog file paths from directories given by an environment variable. Other parameters behave in the same way as in collect_catalogs.
|
Make all the directories in the path which do not exist yet. Like shell's
|
Execute command line in a specific working directory. Like
|
Execute command line and assert success. If the command exits with non-zero zero state, the program aborts.
|
Execute command line and collect stdout, stderr, and exit code.
|
Read content of a text file into list of lines. Only CR, LF, and CR+LF are treated as line breaks. If the given file path is not readable, or text cannot be decoded using given encoding, exceptions are raised. If encoding is not given, the encoding specified by the environment is used.
|
Join path and normalize it with respect to current working directory. Path elements are joined with
|
Convert a raw string value or sequence of values into Unicode. Strings comming in from the environment are frequently raw byte sequences, and need to be converted into Unicode strings according to system locale (e.g. command-line arguments). This function will take either a single raw string or any sequence of raw strings and convert it into a Unicode string or list thereof. If the input value is not a single raw or unicode string, it is assumed to be a sequence of values. In case there are values in the input which are not raw strings, they will be carried over into the result as-is.
|
Convert a unicode string into raw byte sequence. Strings goint to the environment should frequently be raw byte sequences, and need to be converted from Unicode strings according to system locale (e.g. command-line arguments). This function will take either a single Unicode string or any sequence of Unicode strings and convert it into a raw string or list thereof. If the input value is not a single raw or unicode string, it is assumed to be a sequence of values. In case there are values in the input which are not Unicode strings, they will be carried over into the result as-is.
|
Guess user's preferred languages from the environment. Various environment variables are examined to collect the list of languages in which the user may be wanting to read or write in in the environment. The list is ordered from most to least preferred language, and may be empty. Languages are given by their ISO-639 codes.
|
Get number of columns in the terminal of output stream. If the output stream is not linked to the terminal, 0 is returned. If the output stream is linked to the terminal, but the number of columns cannot be determined, the supplied default value is returned instead.
|
Build a path selection function based on inclusion-exclusion condition. Frequently a collection of paths needs to be filtered, to pass only specific paths (inclusion), or to block only specific paths (exclusion), or both. Filtering conditions are normally posed on full paths, but frequently file base names without extensions are really tested. This function builds a selector function which takes a path and
returns If
|
Collect list of paths from the file. In general, non-empty lines in the file are taken to be paths, and
empty lines are skipped. If The If
The path is included if there are no inclusion directives, or it
matches at least one inclusion directive; the path is excluded if it
matches at least one exclusion directive. Inclusion-exclusion directives
are given to build_path_selector to create the path selection
function (with If
|
Collect list of paths from usual sources given on command line. Scripts that process paths will in general get paths directly (as free command line arguments or on standard input), or indirectly from files containing lists of paths (usually given by a command line option). Sometimes input directory paths will be searched for paths of all files in them, possibly of certain type. Especially when searching directory paths, the script may take options to exclude or include only paths that match something. This function conveniently wraps up these possibilities, to fetch all possible paths in single statement. The The order of path collection is as follows. First all paths from
If
|
Get path of current working directory as Unicode string.
|
Gracefully exit a Pology script when an exception is received. Any error message will be printed, any progress lines will be cleared, and keyboard interrupt will exist silently. The backtrace can be shown instead (on non-keyboard interrupt
exceptions) by setting
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jul 24 21:00:26 2014 | http://epydoc.sourceforge.net |