(command, pipe_command=None)
| 236 | return {} |
| 237 | |
| 238 | def run_and_get_stdout(command, pipe_command=None): |
| 239 | if not pipe_command: |
| 240 | p1 = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) |
| 241 | output = p1.communicate()[0] |
| 242 | if not PY2: |
| 243 | output = output.decode(encoding='UTF-8') |
| 244 | return p1.returncode, output |
| 245 | else: |
| 246 | p1 = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) |
| 247 | p2 = subprocess.Popen(pipe_command, stdin=p1.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 248 | p1.stdout.close() |
| 249 | output = p2.communicate()[0] |
| 250 | if not PY2: |
| 251 | output = output.decode(encoding='UTF-8') |
| 252 | return p2.returncode, output |
| 253 | |
| 254 | |
| 255 | def program_paths(program_name): |
no outgoing calls
no test coverage detected
searching dependent graphs…