| 58 | pass |
| 59 | |
| 60 | def launch(self, buffer_output=False, capture_output=False): |
| 61 | # print('*** ENV:', self.env) # dbg |
| 62 | # print('*** CMD:', self.cmd) # dbg |
| 63 | env = os.environ.copy() |
| 64 | env.update(self.env) |
| 65 | if buffer_output: |
| 66 | capture_output = True |
| 67 | self.stdout_capturer = c = StreamCapturer(echo=not buffer_output) |
| 68 | c.start() |
| 69 | stdout = c.writefd if capture_output else None |
| 70 | stderr = subprocess.STDOUT if capture_output else None |
| 71 | self.process = subprocess.Popen(self.cmd, stdout=stdout, |
| 72 | stderr=stderr, env=env) |
| 73 | |
| 74 | def wait(self): |
| 75 | self.process.wait() |