Some environment related functions.
Project description
Some environment related functions.
-
LOGDIR, VARRUN, FLAGDIR: lambdas defining standard places used in other modules
-
envsub: replace substrings of the form '$var' with the value of 'var' from
environ
. -
getenv: fetch environment value, optionally performing substitution
Function envsub(s, environ=None, default=None)
Replace substrings of the form '$var' with the value of 'var' from environ.
Parameters:
environ
: environment mapping, defaultos.environ
.default
: value to substitute for unknown vars; ifdefault
isNone
aValueError
is raised.
Function getenv(var, default=None, environ=None, dosub=False)
Fetch environment value.
Parameters:
var
: name of variable to fetch.default
: default value if not present. If not specified or None, raise KeyError.environ
: environment mapping, defaultos.environ
.dosub
: if true, use envsub() to perform environment variable substitution ondefault
if it used. Default value isFalse
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cs.env-20190103.tar.gz
(2.3 kB
view hashes)