add openai model to config, rework logging to use appdirs logging dir

This commit is contained in:
2025-06-03 15:28:14 +02:00
parent 9684229fc2
commit 3fbb8bbd52
22 changed files with 101 additions and 84 deletions

View File

@@ -1,17 +1,25 @@
__version__ = "0.2.1"
__author__ = "Alexander Kirchner"
__all__ = ["__version__", "__author__", "Icon", "settings"]
from config import Config
import os
from config import Config
from appdirs import AppDirs
app = AppDirs("SemesterApparatsManager", "SAM")
LOG_DIR = app.user_log_dir
CONFIG_DIR = app.user_config_dir
if not os.path.exists(LOG_DIR):
os.makedirs(LOG_DIR)
if not os.path.exists(CONFIG_DIR):
os.makedirs(CONFIG_DIR)
settings = Config("config/config.yaml")
if not os.path.exists(settings.database.temp.expanduser()):
settings.database.temp.expanduser().mkdir(parents=True, exist_ok=True)
from .utils.icon import Icon
__version__ = "0.2.1"
__author__ = "Alexander Kirchner"
if not os.path.exists("logs"):
os.mkdir("logs")
# open and close the file to create it