mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-25 20:34:26 -08:00
33 lines
819 B
Python
33 lines
819 B
Python
import os
|
|
from platform import platform
|
|
|
|
from platformdirs import PlatformDirs
|
|
|
|
from . import APP_NAME, AUTHOR
|
|
|
|
PLATFORM = platform()
|
|
dirs = PlatformDirs(appname=APP_NAME, appauthor=AUTHOR, ensure_exists=True)
|
|
|
|
|
|
# ---- app deps ----
|
|
APP_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
CONFIGS_DIR = os.path.join(APP_DIR, "configs")
|
|
ASSETS_DIR = os.path.join(APP_DIR, "assets")
|
|
|
|
# ----- user configs and data -----
|
|
APP_DATA_DIR = dirs.user_config_dir
|
|
if not APP_DATA_DIR:
|
|
APP_DATA_DIR = dirs.user_data_dir
|
|
|
|
USER_DATA_PATH = os.path.join(APP_DATA_DIR, "user_data.json")
|
|
USER_CONFIG_PATH = os.path.join(APP_DATA_DIR, "config.ini")
|
|
|
|
# cache dir
|
|
APP_CACHE_DIR = dirs.user_cache_dir
|
|
|
|
# video dir
|
|
USER_VIDEOS_DIR = os.path.join(dirs.user_videos_dir, APP_NAME)
|
|
|
|
|
|
USER_NAME = os.environ.get("USERNAME", f"{APP_NAME} user")
|