check enironmental variable BITMESSAGE_HOME to see if we should store config files there

This commit is contained in:
Jonathan Warren 2013-08-26 14:31:59 -04:00
parent 7ad8ce7e1b
commit 3697ba5d95

View File

@ -17,7 +17,17 @@ def loadConfig():
needToCreateKeysFile = False needToCreateKeysFile = False
except: except:
needToCreateKeysFile = True 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: else:
shared.config.read('keys.dat') shared.config.read('keys.dat')
try: try: