3 from util import user_dir
6 default_options = {"gui": "lite", "proxy": { "mode": "none", "host":"localhost", "port":"8080" },
7 "winpos-qt": [100, 100, 840, 400], "winpos-lite": [4, 25, 351, 149], "history": False }
9 def set_key(self, key, value, save = True):
10 self.config[key] = value
14 def save_config(self):
15 f = open(self.config_file_path(), "w+")
16 f.write(json.dumps(self.config))
18 def load_config(self):
19 f = open(self.config_file_path(), "r")
20 file_contents = f.read()
22 user_config = json.loads(file_contents)
24 self.config[i] = user_config[i]
26 self.config = self.default_options
29 def config_file_path(self):
30 return "%s" % (self.config_folder + "/config.json")
33 # Find electrum data folder
34 self.config_folder = user_dir()
35 self.config = self.default_options
37 if os.path.exists(self.config_file_path()):