5 default_options = {"gui": "lite"}
8 f = open(self.config_file_path(), "w+")
9 f.write(json.dumps(self.config))
11 def load_config(self):
12 f = open(self.config_file_path(), "r")
13 file_contents = f.read()
15 self.config = json.loads(file_contents)
17 self.config = self.default_options
20 def config_file_path(self):
21 return "%s" % (self.config_folder + "/config.json")
24 # Find electrum data folder
25 if "HOME" in os.environ:
26 self.config_folder = os.path.join(os.environ["HOME"], ".electrum")
27 elif "LOCALAPPDATA" in os.environ:
28 self.config_folder = os.path.join(os.environ["LOCALAPPDATA"], "Electrum")
29 elif "APPDATA" in os.environ:
30 self.config_folder = os.path.join(os.environ["APPDATA"], "Electrum")
32 raise BaseException("No home directory found in environment variables.")
35 if os.path.exists(self.config_file_path()):
38 self.config = self.default_options