def run(self, command, args): # as we pass popen3 as sequence, it executes monotone with these # arguments - and does not pass them through the shell according # to help(os.popen3) # print(("standalone is running:", command, args)) to_run = self.base_command + [command] + args process = popen2.Popen3(to_run, capturestderr=True) for line in process.fromchild: yield line stderr_data = process.childerr.read() if len(stderr_data) > 0: raise MonotoneException("data on stderr for command '%s': %s" % (command, stderr_data)) terminate_popen3(process)
def stop(self): if not self.process: return terminate_popen3(self.process) self.process = None