From cda3f603bdd43d10f693209a41f243ab6082d06d Mon Sep 17 00:00:00 2001 From: thomasv Date: Mon, 5 Nov 2012 14:02:28 +0100 Subject: [PATCH] default_wallet_file configuration string --- lib/simple_config.py | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/simple_config.py b/lib/simple_config.py index eacdf5c..81cd2ae 100644 --- a/lib/simple_config.py +++ b/lib/simple_config.py @@ -30,15 +30,6 @@ class SimpleConfig: def __init__(self, options=None): - self.wallet_config = {} - if options: - # this will call read_wallet_config only if there is a wallet_path value in options - try: - self.read_wallet_config(options.wallet_path) - except: - pass - - # system conf, readonly self.system_config = {} self.read_system_config() @@ -53,6 +44,23 @@ class SimpleConfig: if options.server: self.options_config['server'] = options.server if options.proxy: self.options_config['proxy'] = options.proxy if options.gui: self.options_config['gui'] = options.gui + + + self.wallet_config = {} + self.wallet_file_exists = False + path = None + if options: + # this will call read_wallet_config only if there is a wallet_path value in options + try: + path = options.wallet_path + except: + pass + if not path: + path = self.get('default_wallet_path') + print "path", path + if path: + self.read_wallet_config(path) + @@ -191,7 +199,6 @@ class SimpleConfig: def read_wallet_config(self, path): """Read the contents of the wallet file.""" - self.wallet_file_exists = False self.init_path(path) try: with open(self.path, "r") as f: -- 1.7.1