🛠️ Values for options passed via command line will be converted to int if necessary. Fixes #83

Settings save fix after refactoring to `StrEnum`.
This commit is contained in:
Robert Honz
2024-04-20 13:50:54 +02:00
parent b972ec01b6
commit 519e856b14
2 changed files with 10 additions and 3 deletions
+5
View File
@@ -34,6 +34,11 @@ class BaseConfig:
f.write(data_json)
def set_option(self, key: str, value: Any) -> None:
tmp_data: Any = getattr(self.data, key)
if isinstance(tmp_data, int) and not isinstance(value, int):
value = int(value)
setattr(self.data, key, value)
def read(self, path: str) -> bool: