Skip to content

Commit

Permalink
Merge pull request #5 from Kaliiiiiiiiii-Vinyzu/Vinyzu-Pull1
Browse files Browse the repository at this point in the history
Exposing Base (And fixing other stuff)
  • Loading branch information
Vinyzu authored Mar 25, 2024
2 parents 8df9236 + 152b066 commit abde9a6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 126 deletions.
5 changes: 5 additions & 0 deletions cdp_patches/input/async_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@ async def __ainit__(self) -> None:
if os.name == "nt":
self._base = WindowsBase(self.pid, self.scale_factor)
else:
# mind to change typing of `self.base` property when implementing
raise NotImplementedError(f"pyinput not implemented yet for {os.name}")
await self._wait_for_window()

self._base._offset_toolbar_height()

@property
def base(self) -> WindowsBase:
return self._base

async def _wait_for_window(self) -> None:
max_wait = time.time() + self.window_timeout
while time.time() < max_wait:
Expand Down
4 changes: 4 additions & 0 deletions cdp_patches/input/sync_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def __init__(self, pid: Optional[int] = None, browser: Optional[sync_browsers] =

self._base._offset_toolbar_height()

@property
def base(self):
return self._base

def _wait_for_window(self) -> None:
max_wait = time.time() + self.window_timeout
while time.time() < max_wait:
Expand Down
3 changes: 2 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# This requirements are for development and testing only, not for production.
flake8==7.0.0
tox==4.14.2
pytest==8.1.1
pytest_asyncio==0.23.6
mypy==1.9.0
types-setuptools==69.2.0.20240317
black==24.3.0
isort==5.13.2
pywinauto==0.6.8
numpy==1.26.4
playwright==1.42.0
Expand Down
44 changes: 0 additions & 44 deletions scratch_driverless.py

This file was deleted.

39 changes: 0 additions & 39 deletions scratch_uia.py

This file was deleted.

42 changes: 0 additions & 42 deletions scratch_win32.py

This file was deleted.

0 comments on commit abde9a6

Please sign in to comment.