26 lines
719 B
Python
26 lines
719 B
Python
__version__ = "0.2.1"
|
|
__author__ = "Alexander Kirchner"
|
|
__all__ = ["__version__", "__author__", "Icon", "settings"]
|
|
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(f"{CONFIG_DIR}/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
|
|
|
|
if not os.path.exists("logs"):
|
|
os.mkdir("logs")
|
|
# open and close the file to create it
|