add files

This commit is contained in:
WorldTeacher
2024-01-26 08:28:01 +01:00
parent dd9ee24a8f
commit 0a9818940c
110 changed files with 21563 additions and 0 deletions

20
src/logic/settings.py Normal file
View File

@@ -0,0 +1,20 @@
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)