def start(self, cmd, args): if self.process != None: self.stop() self.cmd = cmd self.args = args # start the server! self.process = qt.QProcess() self.process.connect('stateChanged(QProcess::ProcessState)', self.onStateChanged) print ("Starting %s with " % cmd, args) self.process.start(cmd, args)
def start(self): # run the process! self.process = qt.QProcess() print( 'running: ', self.executable, self.args) self.process.start(self.executable, self.args) self.process.waitForFinished() if self.process.exitStatus() == qt.QProcess.CrashExit or self.process.exitCode() != 0: stdout = self.process.readAllStandardOutput() stderr = self.process.readAllStandardError() print('exit status is: %d' % self.process.exitStatus()) print('exit code is: %d' % self.process.exitCode()) print('error is: %d' % self.process.error()) print('standard out is: %s' % stdout) print('standard error is: %s' % stderr) raise( UserWarning("Could not run %s with %s" % (self.executable, self.args)) ) stdout = self.process.readAllStandardOutput() return stdout