mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-13 04:05:04 +03:00
8f41eb93ef
Builder Win / Build PluginLoader for Win (push) Has been cancelled
Builder / Build PluginLoader (push) Has been cancelled
Push Updated Plugin Stub to Template / copy-stub (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Type Check / Run type checkers (push) Has been cancelled
* fix incorrect permissions on plugin directories * chown plugin dirs too * fix the stupid * cleanup useless comments
64 lines
1.7 KiB
Python
64 lines
1.7 KiB
Python
from ..enums import UserType
|
|
import os, sys
|
|
|
|
def chown(path : str, user : UserType = UserType.HOST_USER, recursive : bool = True) -> bool:
|
|
return True # Stubbed
|
|
|
|
def chmod(path : str, permissions : int, recursive : bool = True) -> bool:
|
|
return True # Stubbed
|
|
|
|
def file_owner(path : str) -> UserType|None:
|
|
return UserType.HOST_USER # Stubbed
|
|
|
|
def get_home_path(user : UserType = UserType.HOST_USER) -> str:
|
|
return os.path.expanduser("~") # Mostly stubbed
|
|
|
|
def setgid(user : UserType = UserType.HOST_USER):
|
|
pass # Stubbed
|
|
|
|
def setuid(user : UserType = UserType.HOST_USER):
|
|
pass # Stubbed
|
|
|
|
async def service_active(service_name : str) -> bool:
|
|
return True # Stubbed
|
|
|
|
async def service_stop(service_name : str) -> bool:
|
|
return True # Stubbed
|
|
|
|
async def service_start(service_name : str) -> bool:
|
|
return True # Stubbed
|
|
|
|
async def service_restart(service_name : str, block : bool = True) -> bool:
|
|
if service_name == "plugin_loader":
|
|
sys.exit(42)
|
|
|
|
return True # Stubbed
|
|
|
|
def get_effective_username() -> str:
|
|
return os.getlogin()
|
|
|
|
def get_username() -> str:
|
|
return os.getlogin()
|
|
|
|
def get_privileged_path() -> str:
|
|
'''On windows, privileged_path is equal to unprivileged_path'''
|
|
return get_unprivileged_path()
|
|
|
|
def get_unprivileged_path() -> str:
|
|
path = os.getenv("UNPRIVILEGED_PATH")
|
|
|
|
if path == None:
|
|
path = os.getenv("PRIVILEGED_PATH", os.path.join(os.path.expanduser("~"), "homebrew"))
|
|
|
|
os.makedirs(path, exist_ok=True)
|
|
|
|
return path
|
|
|
|
def get_unprivileged_user() -> str:
|
|
return os.getenv("UNPRIVILEGED_USER", os.getlogin())
|
|
|
|
async def restart_webhelper() -> bool:
|
|
return True # Stubbed
|
|
|
|
async def close_cef_socket():
|
|
return # Stubbed |