summaryrefslogtreecommitdiff
path: root/backend/localplatform.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend/localplatform.py')
-rw-r--r--backend/localplatform.py33
1 files changed, 31 insertions, 2 deletions
diff --git a/backend/localplatform.py b/backend/localplatform.py
index c1453227..a788d59f 100644
--- a/backend/localplatform.py
+++ b/backend/localplatform.py
@@ -1,4 +1,4 @@
-import platform
+import platform, os
ON_WINDOWS = platform.system() == "Windows"
ON_LINUX = not ON_WINDOWS
@@ -8,4 +8,33 @@ if ON_WINDOWS:
import localplatformwin as localplatform
else:
from localplatformlinux import *
- import localplatformlinux as localplatform \ No newline at end of file
+ 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:
+ os.getenv("LIVE_RELOAD", "1") == "1"
+
+def get_log_level() -> int:
+ return {"CRITICAL": 50, "ERROR": 40, "WARNING": 30, "INFO": 20, "DEBUG": 10}[
+ os.getenv("LOG_LEVEL", "INFO")
+ ] \ No newline at end of file