MCPcopy
hub / github.com/rsxdalv/TTS-WebUI / _stream_shell_command

Function _stream_shell_command

tts_webui/utils/pip_install.py:135–153  ·  view source on GitHub ↗
(command)

Source from the content-addressed store, hash-verified

133
134
135def _stream_shell_command(command):
136 process = subprocess.Popen(
137 command,
138 shell=True,
139 stdout=subprocess.PIPE,
140 stderr=subprocess.STDOUT,
141 universal_newlines=True,
142 )
143
144 # Stream the output to the console
145 for line in process.stdout: # type: ignore
146 print(line, end="")
147 yield line
148
149 # Wait for the process to finish
150 process.wait()
151
152 if process.returncode != 0:
153 raise Exception(f"Failed to run {command}")

Callers 3

fnFunction · 0.85
_pip_installFunction · 0.85
_pip_uninstallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected