From 5e6cc46299c2dbc5c711add5daee3076b6ae3701 Mon Sep 17 00:00:00 2001 From: welli7ngton Date: Sat, 22 Feb 2025 14:36:04 -0300 Subject: [PATCH 1/2] MNT: Annotate MISC session functions - add annotations to wait_for_file, execute, wait and sleep functions --- botcity/core/bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/botcity/core/bot.py b/botcity/core/bot.py index 10ce7f6..227b4c6 100644 --- a/botcity/core/bot.py +++ b/botcity/core/bot.py @@ -1771,7 +1771,7 @@ def delete(self, wait: int = 0) -> None: # Misc ###### - def wait_for_file(self, path, timeout=10000): + def wait_for_file(self, path: str, timeout: int = 10000) -> bool: """ Invoke the system handler to open the given file. @@ -1793,7 +1793,7 @@ def wait_for_file(self, path, timeout=10000): return True self.sleep(config.DEFAULT_SLEEP_AFTER_ACTION) - def execute(self, file_path): + def execute(self, file_path: str) -> None: """ Invoke the system handler to open the given file. @@ -1805,7 +1805,7 @@ def execute(self, file_path): else: subprocess.Popen(file_path.split(" ")) - def wait(self, interval): + def wait(self, interval: int) -> None: """ Wait / Sleep for a given interval. @@ -1815,7 +1815,7 @@ def wait(self, interval): """ time.sleep(interval / 1000.0) - def sleep(self, interval): + def sleep(self, interval: int) -> None: """ Wait / Sleep for a given interval. From 9f2b50f09d24cc701c3f39332fb1db05ae1555a7 Mon Sep 17 00:00:00 2001 From: welli7ngton Date: Sat, 22 Feb 2025 14:48:16 -0300 Subject: [PATCH 2/2] mnt: annotate browser session --- botcity/core/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botcity/core/bot.py b/botcity/core/bot.py index 227b4c6..17710eb 100644 --- a/botcity/core/bot.py +++ b/botcity/core/bot.py @@ -786,7 +786,7 @@ def get_element_coords_centered( # Browser ######### - def browse(self, url, location=0): + def browse(self, url: str, location: int = 0) -> bool: """ Invoke the default browser passing an URL