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