[Calypso-commits] [calypso] 01/01: Allow to override calypso's config dir

Guido Guenther agx at moszumanska.debian.org
Sat Apr 9 17:49:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch master
in repository calypso.

commit 91a9b2fb92d3fcccc7cb19fd00fd7776c6aa31ff
Author: Guido Günther <agx at sigxcpu.org>
Date:   Sat Apr 9 19:49:08 2016 +0200

    Allow to override calypso's config dir
    
    This can be useful when running automatic tests via e.g. autopkgtest
    where we want to have all files in a temporary directory.
---
 calypso/config.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/calypso/config.py b/calypso/config.py
index dc17eec..59cbd85 100644
--- a/calypso/config.py
+++ b/calypso/config.py
@@ -72,6 +72,9 @@ for section, values in INITIAL_CONFIG.items():
 
 _CONFIG_PARSER.read("/etc/calypso/config")
 _CONFIG_PARSER.read(os.path.expanduser("~/.config/calypso/config"))
+cfg = os.getenv("CALYPSO_CONFIG")
+if cfg:
+    _CONFIG_PARSER.read(cfg)
 
 # Wrap config module into ConfigParser instance
 sys.modules[__name__] = _CONFIG_PARSER

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/calypso/calypso.git



More information about the Calypso-commits mailing list