Skip to content

Commit

Permalink
Lint new changes (#139)
Browse files Browse the repository at this point in the history
* umu_run: remove unused imports

* umu_run: fix format in log statements

* umu_run: log the root display

* umu_run: update log statements

* umu_run: sort import statements
  • Loading branch information
R1kaB3rN authored Jul 5, 2024
1 parent a3d366f commit 6ce812a
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env python3
import os # noqa
import os
import sys
import time
import threading
from Xlib import X, display, Xatom # noqa
import time
from _ctypes import CFuncPtr
from argparse import ArgumentParser, Namespace, RawTextHelpFormatter
from concurrent.futures import Future, ThreadPoolExecutor
Expand All @@ -14,9 +13,11 @@
from pwd import getpwuid
from re import match
from socket import AF_INET, SOCK_DGRAM, socket
from subprocess import PIPE, Popen, run # noqa
from subprocess import Popen
from typing import Any

from Xlib import Xatom, display

from umu_consts import (
DEBUG_FORMAT,
FLATPAK_ID,
Expand All @@ -34,7 +35,6 @@
get_libc,
is_installed_verb,
is_winetricks_verb,
whereis, # noqa
)

AnyPath = os.PathLike | str
Expand Down Expand Up @@ -445,11 +445,11 @@ def get_window_client_ids() -> list[str]:
children = root.query_tree().children
if children and len(children) > 1:
for child in children:
log.debug(f"Window ID: {child.id}") # noqa
log.debug(f"Window Name: {child.get_wm_name()}") # noqa
log.debug(f"Window Class: {child.get_wm_class()}") # noqa
log.debug(f"Window Geometry: {child.get_geometry()}") # noqa
log.debug(f"Window Attributes: {child.get_attributes()}") # noqa
log.debug("Window ID: %s", child.id)
log.debug("Window Name: %s", child.get_wm_name())
log.debug("Window Class: %s", child.get_wm_class())
log.debug("Window Geometry: %s", child.get_geometry())
log.debug("Window Attributes: %s", child.get_attributes())
# if "steam_app" in str(child.get_wm_class()):
window_ids.append(child.id)
return window_ids
Expand All @@ -465,14 +465,12 @@ def set_steam_game_property( # noqa: D103
) -> None:
d = display.Display(":1")
try:
root = d.screen().root # noqa
root = d.screen().root
log.debug("Root: %s", root)

for window_id in window_ids:
log.debug(
"window_id: %s steam_layer: %s",
window_id,
steam_assigned_layer_id,
)
log.debug("window_id: %s", window_id)
log.debug("steam_layer: %s", steam_assigned_layer_id)
try:
window = d.create_resource_object("window", int(window_id))
window.get_full_property(
Expand All @@ -488,12 +486,12 @@ def set_steam_game_property( # noqa: D103
"Successfully set STEAM_GAME property for window ID: %s",
window_id,
)
except Exception as e: # noqa
except Exception as e:
log.error(
"Error setting STEAM_GAME property for window ID %s: %s",
"Error setting STEAM_GAME property for window ID: %s",
window_id,
e,
)
log.exception(e)
except Exception as e:
log.exception(e)
finally:
Expand Down

0 comments on commit 6ce812a

Please sign in to comment.