From 5a7495373938b8ce494003c5fbc843e57fe85faa Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Sun, 27 Sep 2020 19:16:44 +0200 Subject: [PATCH] Add vars() method to configuration.py. Returns some shell variables that are used by various deferred import processes. --- bin/configuration.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/configuration.py b/bin/configuration.py index 0abd8ca..17cf0f7 100644 --- a/bin/configuration.py +++ b/bin/configuration.py @@ -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") +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): if file is None: file = prefix+"/etc/config.yaml"