Add `get_data` method to `ConfigManager` for retrieving specific configuration keys
This commit is contained in:
parent
c2b103f598
commit
46387123bc
|
|
@ -63,4 +63,9 @@ class ConfigManager(metaclass=SingletonMeta):
|
|||
with open(f"{self.config_dir}/config.toml", "wb") as f:
|
||||
tomli_w.dump(self.__data, f)
|
||||
|
||||
def get_data(self,key):
|
||||
if key in self.__data.items():
|
||||
return {key:self.__data[key]}
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue