Use ConfigLoader class
MODIFY
plextraktsync/config.py
plextraktsync/config.py
@@ -80,14 +80,14 @@ def __contains__(self, item):
def initialize(self):
self.initialized = True
- defaults = self.load_json(default_config_file)
+ loader = ConfigLoader()
+ defaults = loader.load_json(default_config_file)
self.update(defaults)
if not exists(self.config_file):
- with open(self.config_file, "w") as fp:
- fp.write(json.dumps(defaults, indent=4))
+ loader.write_json(self.config_file, defaults)
- config = self.load_json(self.config_file)
+ config = loader.load_json(self.config_file)
self.merge(config, self)
override = self["config"]["dotenv_override"]

Use ConfigLoader class