From 3697ba5d95198f37bbdb0dfeaf0ce2703dad17b3 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Mon, 26 Aug 2013 14:31:59 -0400 Subject: [PATCH] check enironmental variable BITMESSAGE_HOME to see if we should store config files there --- src/helper_startup.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/helper_startup.py b/src/helper_startup.py index 2ce4ff2c..95ca618a 100644 --- a/src/helper_startup.py +++ b/src/helper_startup.py @@ -17,7 +17,17 @@ def loadConfig(): needToCreateKeysFile = False except: needToCreateKeysFile = True - + elif "BITMESSAGE_HOME" in os.environ: + shared.appdata = os.environ["BITMESSAGE_HOME"] + if shared.appdata[-1] not in [os.path.sep, os.path.altsep]: + shared.appdata += os.path.sep + shared.config.read(shared.appdata + 'keys.dat') + try: + shared.config.get('bitmessagesettings', 'settingsversion') + print 'Loading config files from directory specified in environmental variable: ' + shared.appdata + needToCreateKeysFile = False + except: + needToCreateKeysFile = True else: shared.config.read('keys.dat') try: