Update compressor for data annotation
This commit is contained in:
@@ -66,14 +66,26 @@ class PythonController:
|
||||
button = parameters["button"]
|
||||
x = parameters["x"]
|
||||
y = parameters["y"]
|
||||
self.execute_python_command(f"pyautogui.click(button='{button}', x={x}, y={y})")
|
||||
if "num_clicks" in parameters:
|
||||
num_clicks = parameters["num_clicks"]
|
||||
self.execute_python_command(f"pyautogui.click(button='{button}', x={x}, y={y}, clicks={num_clicks})")
|
||||
else:
|
||||
self.execute_python_command(f"pyautogui.click(button='{button}', x={x}, y={y})")
|
||||
elif "button" in parameters and "x" not in parameters and "y" not in parameters:
|
||||
button = parameters["button"]
|
||||
self.execute_python_command(f"pyautogui.click(button='{button}')")
|
||||
if "num_clicks" in parameters:
|
||||
num_clicks = parameters["num_clicks"]
|
||||
self.execute_python_command(f"pyautogui.click(button='{button}', clicks={num_clicks})")
|
||||
else:
|
||||
self.execute_python_command(f"pyautogui.click(button='{button}')")
|
||||
elif "button" not in parameters and "x" in parameters and "y" in parameters:
|
||||
x = parameters["x"]
|
||||
y = parameters["y"]
|
||||
self.execute_python_command(f"pyautogui.click(x={x}, y={y})")
|
||||
if "num_clicks" in parameters:
|
||||
num_clicks = parameters["num_clicks"]
|
||||
self.execute_python_command(f"pyautogui.click(x={x}, y={y}, clicks={num_clicks})")
|
||||
else:
|
||||
self.execute_python_command(f"pyautogui.click(x={x}, y={y})")
|
||||
else:
|
||||
raise Exception(f"Unknown parameters: {parameters}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user