Separated updating/writing from saving config
This commit is contained in:
parent
8087e4d445
commit
e9d74c07e6
5 changed files with 27 additions and 21 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue