mirror of
https://github.com/aclist/dztui.git
synced 2026-11-17 15:21:55 +01:00
change: move try statement to outer function
This commit is contained in:
1 parent
ea41503dad
commit
d47d7075e9
1 file changed
+15
-16
+15
-16
@@ -31,12 +31,16 @@ def is_sandboxed() -> bool:
|
||||
return bool(os.environ.get("FLATPAK_ID"))
|
||||
|
||||
|
||||
def get_flatpak_output() -> list[str]:
|
||||
proc = subprocess.check_output(
|
||||
[FLATPAK_CMD, "ps", "--columns=application"], text=True
|
||||
)
|
||||
lines = proc.splitlines()
|
||||
return lines
|
||||
def get_flatpak_output() -> list[str] | None:
|
||||
try:
|
||||
proc = subprocess.check_output(
|
||||
[FLATPAK_CMD, "ps", "--columns=application"], text=True
|
||||
)
|
||||
lines = proc.splitlines()
|
||||
return lines
|
||||
except Exception as e:
|
||||
logger.debug(e)
|
||||
return None
|
||||
|
||||
|
||||
def is_flatpak_steam_running() -> bool:
|
||||
@@ -44,17 +48,12 @@ def is_flatpak_steam_running() -> bool:
|
||||
return True
|
||||
if has_cmd(FLATPAK_CMD) is False:
|
||||
return False
|
||||
try:
|
||||
proc = subprocess.check_output(
|
||||
[FLATPAK_CMD, "ps", "--columns=application"], text=True
|
||||
)
|
||||
lines = proc.splitlines()
|
||||
if FLATPAK_APPID in lines:
|
||||
return True
|
||||
return False
|
||||
except Exception as e:
|
||||
logger.debug(e)
|
||||
lines = get_flatpak_output()
|
||||
if lines is None:
|
||||
return False
|
||||
if FLATPAK_APPID in lines:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def get_steam_procs() -> list[list[str]]:
|
||||
|
||||
Reference in new issue
Block a user