[Calypso] [PATCH] Allow to override calypso's config dir

Petter Reinholdtsen pere at hungry.com
Sun Jan 24 03:37:46 PST 2016


Here is another patch from Guido, found via
<URL: git://prometheus.amsuess.com/calypso-patches >.  He added this
comment to it in 2014:

  This can be useful when running automatic tests via e.g. autopkgtest
  where we want to have all files in a temporary directory.

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


-- 
Happy hacking
Petter Reinholdtsen


More information about the Calypso mailing list