Finish loading the vscode examples v1; Improve on the infra: Add accessibility tree into the observation; Add activate window function, etc
This commit is contained in:
@@ -1,14 +1,30 @@
|
||||
from typing import Any
|
||||
from typing import Dict
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
|
||||
from .file import get_vm_file
|
||||
from .replay import get_replay
|
||||
|
||||
logger = logging.getLogger("desktopenv.getters.vscode")
|
||||
|
||||
|
||||
def get_vscode_config(env, config: Dict[str, Any]) -> str:
|
||||
trajectory = [{"type": "hotkey", "param": ["command", "shift", "p"]},
|
||||
{"type": "typewrite", "param": "OpenProject"},
|
||||
{"type": "press", "param": "enter"}]
|
||||
os_type = env.vm_platform
|
||||
vscode_extension_command = config["vscode_extension_command"]
|
||||
|
||||
# fixme: depends on how we config and install the vscode in virtual machine, need to be aligned and double-checked
|
||||
|
||||
if os_type == "MacOS":
|
||||
trajectory = [
|
||||
{"type": "hotkey", "param": ["command", "shift", "p"]},
|
||||
{"type": "typewrite", "param": vscode_extension_command},
|
||||
{"type": "press", "param": "enter"}
|
||||
]
|
||||
else:
|
||||
trajectory = [
|
||||
{"type": "hotkey", "param": ["ctrl", "shift", "p"]},
|
||||
{"type": "typewrite", "param": vscode_extension_command},
|
||||
{"type": "press", "param": "enter"}
|
||||
]
|
||||
|
||||
get_replay(env, trajectory)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user