Browse Source

Changed how load_config works so it always supports new config vars

283
bkkcoins 12 years ago
parent
commit
8244768654
  1. 9
      lib/simple_config.py

9
lib/simple_config.py

@ -18,7 +18,9 @@ class SimpleConfig:
f = open(self.config_file_path(), "r")
file_contents = f.read()
if file_contents:
self.config = json.loads(file_contents)
user_config = json.loads(file_contents)
for i in user_config:
self.config[i] = user_config[i]
else:
self.config = self.default_options
self.save_config()
@ -29,10 +31,9 @@ class SimpleConfig:
def __init__(self):
# Find electrum data folder
self.config_folder = user_dir()
self.config = self.default_options
# Read the file
if os.path.exists(self.config_file_path()):
self.load_config()
else:
self.config = self.default_options
self.save_config()
self.save_config()

Loading…
Cancel
Save