diff --git a/Shared/Config.py b/Shared/Config.py index bcc139c..de65b63 100644 --- a/Shared/Config.py +++ b/Shared/Config.py @@ -36,6 +36,16 @@ class Config: def read_from_file(self, file): if isfile(file): config = load_source("config", file) + for option in self.options: + found = False + for attr in dir(config): + if not attr.startswith("__"): + if option.name == attr: + found = True + break + if not found: + self.write_to_file(file) + return self.read_from_file(file) return config else: raise FileNotFoundError() @@ -64,4 +74,4 @@ class Config: def __repr__(self): - return self.get() \ No newline at end of file + return self.get()