Add vars() method to configuration.py.

Returns some shell variables that are used
by various deferred import processes.
This commit is contained in:
D. Berge
2020-09-27 19:16:44 +02:00
parent 303befef3b
commit 5a74953739

View File

@@ -13,6 +13,17 @@ $HOME is the home directory of the user running this script.
prefix = os.environ.get("DOUGAL_ROOT", os.environ.get("HOME", ".")+"/software") prefix = os.environ.get("DOUGAL_ROOT", os.environ.get("HOME", ".")+"/software")
DOUGAL_ROOT = os.environ.get("DOUGAL_ROOT", os.environ.get("HOME", ".")+"/software")
VARDIR = os.environ.get("VARDIR", DOUGAL_ROOT+"/var")
LOCKFILE = os.environ.get("LOCKFILE", VARDIR+"/runner.lock")
def vars ():
return {
"DOUGAL_ROOT": DOUGAL_ROOT,
"VARDIR": VARDIR,
"LOCKFILE": LOCKFILE
}
def read (file = None): def read (file = None):
if file is None: if file is None:
file = prefix+"/etc/config.yaml" file = prefix+"/etc/config.yaml"