Skip to content

Commit

Permalink
Fix Xdo Import
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinyzu committed Apr 8, 2024
1 parent cd49390 commit 000379e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions cdp_patches/input/async_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@
InputBase = WindowsBase # type: ignore
WindowErrors = (AssertionError, ValueError, ElementNotVisible, ElementNotEnabled) # type: ignore[assignment]
else:
from xdo.xdo import XdoException

from cdp_patches.input.os_base.linux import LinuxBase # type: ignore[assignment]

WindowsBase: TypeAlias = LinuxBase # type: ignore[no-redef]
InputBase = LinuxBase # type: ignore
WindowErrors = (AssertionError, ValueError, XdoException) # type: ignore[assignment]
WindowErrors = (AssertionError, ValueError) # type: ignore[assignment]

from .browsers import async_browsers, get_async_browser_pid, get_async_scale_factor
from .mouse_trajectory import HumanizeMouseTrajectory
Expand Down
3 changes: 2 additions & 1 deletion cdp_patches/input/os_base/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def search_windows_by_pid(query_tree, pid: int):
search_windows_by_pid(window.query_tree(), pid)

search_windows_by_pid(self.display.screen().root.query_tree(), self.pid)
assert res_windows, ValueError(f"No windows found for PID: {self.pid}")

for window in res_windows:
# Getting necessary window properties
Expand All @@ -118,7 +119,7 @@ def search_windows_by_pid(query_tree, pid: int):
self.browser_window = window
return self.browser_window

raise ValueError("No browser window found")
raise ValueError(f"No windows found for PID: {self.pid}")

def _offset_toolbar_height(self) -> Tuple[int, int]:
# Get Window Location
Expand Down
4 changes: 1 addition & 3 deletions cdp_patches/input/sync_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
InputBase = WindowsBase # type: ignore
WindowErrors = (AssertionError, ValueError, ElementNotVisible, ElementNotEnabled) # type: ignore[assignment]
else:
from xdo.xdo import XdoException

from cdp_patches.input.os_base.linux import LinuxBase # type: ignore[assignment]

WindowsBase: TypeAlias = LinuxBase # type: ignore[no-redef]
InputBase = LinuxBase # type: ignore
WindowErrors = (AssertionError, ValueError, XdoException) # type: ignore[assignment]
WindowErrors = (AssertionError, ValueError) # type: ignore[assignment]

from .browsers import get_sync_browser_pid, get_sync_scale_factor, sync_browsers
from .mouse_trajectory import HumanizeMouseTrajectory
Expand Down

0 comments on commit 000379e

Please sign in to comment.