Separated updating/writing from saving config

This commit is contained in:
Joel Collins 2019-01-31 13:51:02 +00:00
parent 8087e4d445
commit e9d74c07e6
5 changed files with 27 additions and 21 deletions

View file

@ -109,17 +109,14 @@ class OpenflexureConfig:
@property
def config(self):
return self.read()
def read(self):
return self._config
def asdict(self):
return self._config
def update(self, update_dict: dict):
def write(self, update_dict: dict):
self._config.update(update_dict)
def overwrite(self, new_dict: dict):
self._config = new_dict
def load(self):
# Unexpanded config dictionary (used at load/save time)
self._config = load_yaml_file(self.config_path)