From ddd1da2d78f715dbac3e3eec1725f900b61811a0 Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Sun, 26 Nov 2023 23:48:20 +0800 Subject: [PATCH] remove old code --- desktop_env/envs/desktop_env.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/desktop_env/envs/desktop_env.py b/desktop_env/envs/desktop_env.py index 8b51c5b..501c135 100644 --- a/desktop_env/envs/desktop_env.py +++ b/desktop_env/envs/desktop_env.py @@ -96,31 +96,9 @@ class DesktopEnv(gym.Env): else: return stdout.decode() - def _execute_xdotool_command(self, command: list[str]) -> None: - result = self.ssh_connection.run(f"DISPLAY=:0 xdotool {command}", hide=True) - return result.stdout.strip() - def _save_state(self): self._execute_command(["vmrun", "-T", "ws" "snapshot", self.path_to_vm, self.snapshot_path]) - def _click(self, click: MouseClick): - self._execute_xdotool_command(f"click {click.value}") - - def _mousedown(self, click: MouseClick): - self._execute_xdotool_command(f"mousedown {click.value}") - - def _mouseup(self, click: MouseClick): - self._execute_xdotool_command(f"mouseup {click.value}") - - def _mouse_move(self, x: int, y: int): - self._execute_xdotool_command(f"mousemove {x} {y}") - - def _key(self, key: str): - self._execute_xdotool_command(f"key {key}") - - def _type(self, text: str): - self._execute_xdotool_command(f"type {text}") - def _get_screenshot(self): image_path = "./screenshot.png" self._execute_command(["vmrun", "-T", "ws", "-gu", self.username, "-gp", self.password, "captureScreen", self.path_to_vm, image_path])