-
Notifications
You must be signed in to change notification settings - Fork 23
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
Mnt/annotate keyboard methods #58
Mnt/annotate keyboard methods #58
Conversation
Sorry for the size of the PR, guys, but had some 'automate' changes because of the black formatter and the keyboard session is pretty big ;) |
@welli7ngton great work! Just an observation, I noticed that in some keyboard methods, the parameter type or return type was missing:
Could you please revisit these methods to validate if any adjustments are needed? |
@joao-voltarelli Alright, asap i'll be solving this! |
@joao-voltarelli Done! can you give a second check please? |
botcity/core/bot.py
Outdated
def paste(self, text: Optional[str] = None) -> None: | ||
""" | ||
Paste content from the clipboard. | ||
|
||
Args: | ||
text (str, optional): The text to be pasted. Defaults to None | ||
wait (int, optional): Wait interval (ms) after task | ||
""" | ||
if text: | ||
pyperclip.copy(text) | ||
self.control_v() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@welli7ngton There was a small problem in our implementation as 'wait' was not being used properly in this method. So, I'm leaving a suggestion for a fix here instead of removing the parameter so that it remains compatible with existing codes. Could you please check?
def paste(self, text: Optional[str] = None) -> None: | |
""" | |
Paste content from the clipboard. | |
Args: | |
text (str, optional): The text to be pasted. Defaults to None | |
wait (int, optional): Wait interval (ms) after task | |
""" | |
if text: | |
pyperclip.copy(text) | |
self.control_v() | |
def paste(self, text: Optional[str] = None, wait: int = 0) -> None: | |
""" | |
Paste content from the clipboard. | |
Args: | |
text (str, optional): The text to be pasted. Defaults to None | |
wait (int, optional): Wait interval (ms) after task | |
""" | |
if text: | |
pyperclip.copy(text) | |
self.control_v() | |
delay = max(0, wait or config.DEFAULT_SLEEP_AFTER_ACTION) | |
self.sleep(delay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, im working on it! sorry, i haven't thought about this possible incompatibility
botcity/core/bot.py
Outdated
""" | ||
Press keys CTRL+C | ||
|
||
Args: | ||
wait (int, optional): Wait interval (ms) after task | ||
|
||
""" | ||
self.control_key(key_to_press='c', wait=wait) | ||
self.control_key(key_to_press="c", wait=wait) | ||
return self.get_clipboard() | ||
|
||
def control_v(self, wait=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def control_v(self, wait=0): | |
def control_v(self, wait: int = 0) -> None: |
botcity/core/bot.py
Outdated
def control_home(self, wait: int = 0) -> None: | ||
""" | ||
Press keys CTRL+Home | ||
press keys ctrl+home | ||
|
||
Args: | ||
wait (int, optional): Wait interval (ms) after task | ||
args: | ||
wait (int, optional): wait interval (ms) after task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusting lowercase
def control_home(self, wait: int = 0) -> None: | |
""" | |
Press keys CTRL+Home | |
press keys ctrl+home | |
Args: | |
wait (int, optional): Wait interval (ms) after task | |
args: | |
wait (int, optional): wait interval (ms) after task | |
def control_home(self, wait: int = 0) -> None: | |
""" | |
Press keys CTRL+Home | |
Args: | |
wait (int, optional): Wait interval (ms) after task |
@welli7ngton Thanks for the adjustments, it looks great! |
Co-authored-by: João Victor Voltarelli <[email protected]>
Co-authored-by: João Victor Voltarelli <[email protected]>
@welli7ngton great work! Thanks for the contribution |
some methods were using single quotes and some were using double, my formatter (black)
changed all the quotes to double quotes, and changed the indent of methods (
find_multiple, find, find_until, find_all, find_text,
click, click_relative, double_click_relative,
triple_click_relative, right_click, right_click_relative,
find_app_element
)