From 27e5f0bd2212032fceb62c0e44730ee509350502 Mon Sep 17 00:00:00 2001 From: Dom Rodriguez Date: Sat, 13 Jul 2024 11:50:45 +0100 Subject: [PATCH] feat: Add more consts Signed-off-by: Dom Rodriguez --- wemod_launcher/consts.py | 17 +++++++++++++---- wemod_launcher/utils/consts.py | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/wemod_launcher/consts.py b/wemod_launcher/consts.py index 0e4e10d..d1f51d2 100644 --- a/wemod_launcher/consts.py +++ b/wemod_launcher/consts.py @@ -3,6 +3,8 @@ import os from pathlib import Path from .utils.configuration import Configuration +from .utils.consts import Consts +from .pfx.wine_utils import WineUtils cfg: Configuration = Configuration() @@ -101,11 +103,18 @@ def get_scan_folder() -> str: return scan_folder -SCRIPT_IMP_FILE = os.path.realpath(__file__) -SCRIPT_PATH = os.path.dirname(SCRIPT_IMP_FILE) -BAT_COMMAND = ["start", winpath(os.path.join(SCRIPT_PATH, "wemod.bat"))] +CONSTS = Consts() +WINE_UTILS = WineUtils() + + +SCRIPT_IMP_FILE = str(CONSTS.SCRIPT_PATH) +SCRIPT_PATH = str(CONSTS.SCRIPT_RUNTIME_DIR) +BAT_COMMAND = [ + "start", + WINE_UTILS.native_path(os.path.join(SCRIPT_IMP_FILE, "wemod.bat")), +] BASE_STEAM_COMPAT = get_scan_folder() -STEAM_COMPAT_FOLDER = os.path.dirname(BASE_STEAM_COMPAT) +STEAM_COMPAT_FOLDER = str(CONSTS.STEAM_COMPAT_DATA_DIR) SCAN_FOLDER = get_scan_folder() WINETRICKS = os.path.join(SCRIPT_PATH, "winetricks") WINEPREFIX = os.path.join(BASE_STEAM_COMPAT, "pfx") diff --git a/wemod_launcher/utils/consts.py b/wemod_launcher/utils/consts.py index 16bf672..f176372 100644 --- a/wemod_launcher/utils/consts.py +++ b/wemod_launcher/utils/consts.py @@ -8,6 +8,7 @@ class Consts: SCRIPT_RUNTIME_DIR: Path = Path( os.path.dirname(os.path.realpath(__file__)) ) + SCRIPT_PATH: Path = Path(os.path.realpath(__file__)) STEAM_COMPAT_DATA_DIR: Path = Path( os.getenv( "STEAM_COMPAT_DATA_PATH",