Skip to content

MNT: Final Annotation #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions botcity/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _to_dict(lbs, elems):
else:
return _to_dict(labels, results)

def _fix_retina_element(self, ele):
def _fix_retina_element(self, ele: cv2find.Box) -> cv2find.Box:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this Box type was a good option.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay to use it this way, but I can do some tests to validate it.

if not is_retina():
return ele

Expand Down Expand Up @@ -1831,7 +1831,7 @@ def sleep(self, interval: int) -> None:

@if_windows_os
def connect_to_app(
self, backend=Backend.WIN_32, timeout=60000, **connection_selectors
self, backend: Backend = Backend.WIN_32, timeout: int = 60000, **connection_selectors: dict[str, Any]
) -> "Application":
"""
Connects to an instance of an open application.
Expand All @@ -1853,7 +1853,9 @@ def connect_to_app(
return self.app

@if_app_connected
def find_app_window(self, waiting_time=10000, **selectors) -> "WindowSpecification":
def find_app_window(
self, waiting_time: int = 10000, **selectors: dict[str, Any]
) -> "WindowSpecification":
"""
Find a window of the currently connected application using the available selectors.

Expand All @@ -1874,8 +1876,8 @@ def find_app_window(self, waiting_time=10000, **selectors) -> "WindowSpecificati
def find_app_element(
self,
from_parent_window: "WindowSpecification" = None,
waiting_time=10000,
**selectors,
waiting_time: int = 10000,
**selectors: dict[str, Any]
) -> "WindowSpecification":
"""
Find a element of the currently connected application using the available selectors.
Expand Down