(self, x, y, timeframe=0.27, uc_lock=False)
| 2711 | return self.gui_hover_element(selector, timeframe=timeframe) |
| 2712 | |
| 2713 | def __gui_hover_x_y(self, x, y, timeframe=0.27, uc_lock=False): |
| 2714 | self.__install_pyautogui_if_missing() |
| 2715 | import pyautogui |
| 2716 | pyautogui = self.__get_configured_pyautogui(pyautogui) |
| 2717 | screen_width, screen_height = pyautogui.size() |
| 2718 | if x < 0 or y < 0 or x > screen_width or y > screen_height: |
| 2719 | raise Exception( |
| 2720 | "PyAutoGUI cannot hover on point (%s, %s)" |
| 2721 | " outside screen. (Width: %s, Height: %s)" |
| 2722 | % (x, y, screen_width, screen_height) |
| 2723 | ) |
| 2724 | if uc_lock: |
| 2725 | gui_lock = FileLock(constants.MultiBrowser.PYAUTOGUILOCK) |
| 2726 | with gui_lock: # Prevent issues with multiple processes |
| 2727 | if "--debug" in sys.argv: |
| 2728 | print(" <DEBUG> pyautogui.moveTo(%s, %s)" % (x, y)) |
| 2729 | pyautogui.moveTo(x, y, timeframe, pyautogui.easeOutQuad) |
| 2730 | time.sleep(0.056) |
| 2731 | else: |
| 2732 | # Called from a method where the gui_lock is already active |
| 2733 | if "--debug" in sys.argv: |
| 2734 | print(" <DEBUG> pyautogui.moveTo(%s, %s)" % (x, y)) |
| 2735 | pyautogui.moveTo(x, y, timeframe, pyautogui.easeOutQuad) |
| 2736 | time.sleep(0.056) |
| 2737 | |
| 2738 | def gui_hover_x_y(self, x, y, timeframe=0.27): |
| 2739 | gui_lock = FileLock(constants.MultiBrowser.PYAUTOGUILOCK) |
no test coverage detected