3 from util import user_dir
6 default_options = {"gui": "lite", "proxy": { "mode": "none", "host":"localhost", "port":"8080" } }
8 def set_key(self, key, value, save = True):
9 self.config[key] = value
13 def save_config(self):
14 f = open(self.config_file_path(), "w+")
15 f.write(json.dumps(self.config))
17 def load_config(self):
18 f = open(self.config_file_path(), "r")
19 file_contents = f.read()
21 user_config = json.loads(file_contents)
23 self.config[i] = user_config[i]
25 self.config = self.default_options
28 def config_file_path(self):
29 return "%s" % (self.config_folder + "/config.json")
32 # Find electrum data folder
33 self.config_folder = user_dir()
34 self.config = self.default_options
36 if os.path.exists(self.config_file_path()):