MCPcopy Create free account
hub / github.com/HexHive/NASS / exec_cmd

Function exec_cmd

fans/fans_api.py:91–108  ·  view source on GitHub ↗
(command)

Source from the content-addressed store, hash-verified

89
90
91def exec_cmd(command):
92 log.info(f"executing {command}")
93 process = subprocess.Popen(
94 command,
95 stdout=subprocess.PIPE,
96 stderr=subprocess.PIPE,
97 text=True, # If you want to handle the output as strings rather than bytes
98 bufsize=1, # Line buffered
99 universal_newlines=True,
100 shell=True,
101 encoding="utf-8",
102 errors="replace"
103 )
104 for stdout_line in iter(process.stdout.readline, ""):
105 yield stdout_line
106 return_code = process.wait()
107 for stderr_line in iter(process.stderr.readline, ""):
108 yield stderr_line

Callers 2

orchestrate_fuzzFunction · 0.70
replayFunction · 0.70

Calls 1

waitMethod · 0.45

Tested by

no test coverage detected