3 from util import user_dir
6 default_options = {"gui": "lite", "proxy": { "mode": "off", "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 self.config = json.loads(file_contents)
23 self.config = self.default_options
26 def config_file_path(self):
27 return "%s" % (self.config_folder + "/config.json")
30 # Find electrum data folder
31 self.config_folder = user_dir()
33 if os.path.exists(self.config_file_path()):
36 self.config = self.default_options