From 6f7a9eeecc487e5492bcbea063a47fca67abf0fe Mon Sep 17 00:00:00 2001 From: Wellington Date: Fri, 7 Mar 2025 14:52:56 -0300 Subject: [PATCH 1/2] MNT: add annotation to the Application session and '_fix_retina_element' function. --- botcity/core/bot.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/botcity/core/bot.py b/botcity/core/bot.py index 17710eb..55d4e4a 100644 --- a/botcity/core/bot.py +++ b/botcity/core/bot.py @@ -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: if not is_retina(): return ele @@ -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.WIN_32, timeout: int = 60000, **connection_selectors: dict ) -> "Application": """ Connects to an instance of an open application. @@ -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 + ) -> "WindowSpecification": """ Find a window of the currently connected application using the available selectors. @@ -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, ) -> "WindowSpecification": """ Find a element of the currently connected application using the available selectors. From 5e500da3dd3998c06772ce86650c400de18191da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Voltarelli?= <65928976+joao-voltarelli@users.noreply.github.com> Date: Tue, 22 Apr 2025 12:14:34 -0300 Subject: [PATCH 2/2] ENH: Adjusting parameters type --- botcity/core/bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/botcity/core/bot.py b/botcity/core/bot.py index 55d4e4a..aa8728d 100644 --- a/botcity/core/bot.py +++ b/botcity/core/bot.py @@ -1831,7 +1831,7 @@ def sleep(self, interval: int) -> None: @if_windows_os def connect_to_app( - self, backend=Backend.WIN_32, timeout: int = 60000, **connection_selectors: dict + self, backend: Backend = Backend.WIN_32, timeout: int = 60000, **connection_selectors: dict[str, Any] ) -> "Application": """ Connects to an instance of an open application. @@ -1854,7 +1854,7 @@ def connect_to_app( @if_app_connected def find_app_window( - self, waiting_time: int = 10000, **selectors: dict + self, waiting_time: int = 10000, **selectors: dict[str, Any] ) -> "WindowSpecification": """ Find a window of the currently connected application using the available selectors. @@ -1877,7 +1877,7 @@ def find_app_element( self, from_parent_window: "WindowSpecification" = None, waiting_time: int = 10000, - **selectors: dict, + **selectors: dict[str, Any] ) -> "WindowSpecification": """ Find a element of the currently connected application using the available selectors.