Files
SemesterapparatsManager/src/logic/settings.py
WorldTeacher 0a9818940c add files
2024-01-26 08:28:01 +01:00

21 lines
553 B
Python

import yaml
from dataclasses import dataclass, field
@dataclass
class Settings:
"""Settings for the app."""
save_path: str
database_name: str
database_path: str
default_apps:bool = True
custom_applications: list[dict] = field(default_factory=list)
def save_settings(self):
"""Save the settings to the config file."""
with open("config.yaml", "w") as f:
yaml.dump(self.__dict__, f)
#open the config file and load the settings
with open("config.yaml", "r") as f:
data = yaml.safe_load(f)