Resolve conflicts

This commit is contained in:
Timothyxxx
2024-01-13 22:58:20 +08:00
18 changed files with 502 additions and 25 deletions

View File

@@ -3,3 +3,5 @@ from .info import get_vm_screen_size, get_vm_window_size, get_vm_wallpaper
from .misc import get_rule, get_accessibility_tree
from .vlc import get_vlc_playing_info, get_vlc_config
from .chrome import get_default_search_engine, get_cookie_data, get_bookmarks, get_open_tabs_info, get_pdf_from_url, get_shortcuts_on_desktop
from .replay import get_replay
from .vscode import get_vscode_config

View File

@@ -0,0 +1,19 @@
from typing import List, Dict, Any
def get_replay(env, trajectory: List[Dict[str, Any]]) -> None:
def parse(action):
if action["type"] == "hotkey":
keys = "', '".join(action["param"])
return f"pyautogui.hotkey('{keys}')"
if action["type"] == "typewrite":
text = action["param"]
return f"pyautogui.typewrite('{text}')"
if action["type"] == "press":
key = action["param"]
return f"pyautogui.press('{key}')"
for action in trajectory:
env.controller.execute_python_command(parse(action))

View File

@@ -0,0 +1,13 @@
from typing import Dict
from typing import Any
from replay import get_replay
from file import get_vm_file
def get_vscode_config(env, config: Dict[str, Any]) -> str:
get_replay(env, config["trajectory"])
return get_vm_file(env, {
"path": config["path"],
"dest": config["dest"]
})