MCPcopy
hub / github.com/zai-org/Open-AutoGLM / _run_hdc_command

Function _run_hdc_command

phone_agent/hdc/connection.py:17–38  ·  view source on GitHub ↗

Run HDC command with optional verbose output. Args: cmd: Command list to execute. **kwargs: Additional arguments for subprocess.run. Returns: CompletedProcess result.

(cmd: list, **kwargs)

Source from the content-addressed store, hash-verified

15
16
17def _run_hdc_command(cmd: list, **kwargs) -> subprocess.CompletedProcess:
18 """
19 Run HDC command with optional verbose output.
20
21 Args:
22 cmd: Command list to execute.
23 **kwargs: Additional arguments for subprocess.run.
24
25 Returns:
26 CompletedProcess result.
27 """
28 if _HDC_VERBOSE:
29 print(f"[HDC] Running command: {' '.join(cmd)}")
30
31 result = subprocess.run(cmd, **kwargs)
32
33 if _HDC_VERBOSE and result.returncode != 0:
34 print(f"[HDC] Command failed with return code {result.returncode}")
35 if hasattr(result, 'stderr') and result.stderr:
36 print(f"[HDC] Error: {result.stderr}")
37
38 return result
39
40
41def set_hdc_verbose(verbose: bool):

Callers 15

_send_keyeventMethod · 0.90
type_textFunction · 0.90
clear_textFunction · 0.90
restore_keyboardFunction · 0.90
get_screenshotFunction · 0.90
get_current_appFunction · 0.90
tapFunction · 0.90
double_tapFunction · 0.90
long_pressFunction · 0.90
swipeFunction · 0.90
backFunction · 0.90

Calls 1

runMethod · 0.45

Tested by

no test coverage detected