Support autostart when running from source

This commit is contained in:
DevilXD committed 2024-10-27 13:13:30 +01:00
1 parent d8687b6d1b
commit b7924231a4
2 files changed
+15 -3

No files matched your search

+6
View File
@@ -33,6 +33,11 @@ else:
# The Lib folder is also spelled in lowercase: 'lib'
version_info = sys.version_info
SYS_SITE_PACKAGES = f"lib/python{version_info.major}.{version_info.minor}/site-packages"
# scripts venv path changes depending on the system platform
if sys.platform == "win32":
SYS_SCRIPTS = "Scripts"
else:
SYS_SCRIPTS = "bin"
def _resource_path(relative_path: Path | str) -> Path:
@@ -90,6 +95,7 @@ WORKING_DIR = SELF_PATH.parent
# Development paths
VENV_PATH = Path(WORKING_DIR, "env")
SITE_PACKAGES_PATH = Path(VENV_PATH, SYS_SITE_PACKAGES)
SCRIPTS_PATH = Path(VENV_PATH, SYS_SCRIPTS)
# Translations path
# NOTE: These don't have to be available to the end-user, so the path points to the internal dir
LANG_PATH = _resource_path("lang")