Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
  • Loading branch information
ErikBjare and ellipsis-dev[bot] authored Oct 24, 2024
1 parent c110124 commit 304dc96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gptme/tools/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def run_xdotool(cmd: str, display: str | None = None) -> str:
display_prefix = f"DISPLAY={display} " if display else ""
full_cmd = f"{display_prefix}xdotool {cmd}"
proc = subprocess.Popen(
full_cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
full_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
Expand Down Expand Up @@ -173,7 +173,7 @@ def computer_action(
x, y = scale_coordinates(
ScalingSource.COMPUTER, width, height, width, height
)
os.system(f"convert {path} -resize {x}x{y}! {path}")
subprocess.run(f"convert {path} -resize {x}x{y}! {path}", shell=True, check=True)
yield Message("system", f"Screenshot saved to {path}", files=[path])

elif action == "cursor_position":
Expand Down

0 comments on commit 304dc96

Please sign in to comment.