diff options
| author | TrainDoctor <traindoctor@protonmail.com> | 2023-10-25 19:47:33 -0700 |
|---|---|---|
| committer | TrainDoctor <traindoctor@protonmail.com> | 2023-10-25 19:47:33 -0700 |
| commit | a7669799bca3ff4089ab81fde924b2d2f787cf0f (patch) | |
| tree | 0afcb03ec1c01efac90be81674df649d6cef186e /backend/localplatform.py | |
| parent | dacd2c19eb51ba525288fccb3ded653e45ca4409 (diff) | |
| download | decky-loader-a7669799bca3ff4089ab81fde924b2d2f787cf0f.tar.gz decky-loader-a7669799bca3ff4089ab81fde924b2d2f787cf0f.zip | |
Merge aa/type-cleanup-py (work by marios, aa, wolv)v2.10.6-pre1
Diffstat (limited to 'backend/localplatform.py')
| -rw-r--r-- | backend/localplatform.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/backend/localplatform.py b/backend/localplatform.py deleted file mode 100644 index 43043ad0..00000000 --- a/backend/localplatform.py +++ /dev/null @@ -1,52 +0,0 @@ -import platform, os - -ON_WINDOWS = platform.system() == "Windows" -ON_LINUX = not ON_WINDOWS - -if ON_WINDOWS: - from localplatformwin import * - import localplatformwin as localplatform -else: - from localplatformlinux import * - import localplatformlinux as localplatform - -def get_privileged_path() -> str: - '''Get path accessible by elevated user. Holds plugins, decky loader and decky loader configs''' - return localplatform.get_privileged_path() - -def get_unprivileged_path() -> str: - '''Get path accessible by non-elevated user. Holds plugin configuration, plugin data and plugin logs. Externally referred to as the 'Homebrew' directory''' - return localplatform.get_unprivileged_path() - -def get_unprivileged_user() -> str: - '''Get user that should own files made in unprivileged path''' - return localplatform.get_unprivileged_user() - -def get_chown_plugin_path() -> bool: - return os.getenv("CHOWN_PLUGIN_PATH", "1") == "1" - -def get_server_host() -> str: - return os.getenv("SERVER_HOST", "127.0.0.1") - -def get_server_port() -> int: - return int(os.getenv("SERVER_PORT", "1337")) - -def get_live_reload() -> bool: - return os.getenv("LIVE_RELOAD", "1") == "1" - -def get_keep_systemd_service() -> bool: - return os.getenv("KEEP_SYSTEMD_SERVICE", "0") == "1" - -def get_log_level() -> int: - return {"CRITICAL": 50, "ERROR": 40, "WARNING": 30, "INFO": 20, "DEBUG": 10}[ - os.getenv("LOG_LEVEL", "INFO") - ] - -def get_selinux() -> bool: - if ON_LINUX: - from subprocess import check_output - try: - if (check_output("getenforce").decode("ascii").strip("\n") == "Enforcing"): return True - except FileNotFoundError: - pass - return False |
