From: Barış Metin Date: Mon, 27 Sep 2010 15:54:43 +0000 (+0200) Subject: just print process output (to log window) X-Git-Tag: sface-0.1-3~4 X-Git-Url: http://git.onelab.eu/?p=sface.git;a=commitdiff_plain;h=cefadc898b3a60ceded6b2564b8ab6224afb1257 just print process output (to log window) --- diff --git a/sface/sfiprocess.py b/sface/sfiprocess.py index 6101889..c1f3b95 100644 --- a/sface/sfiprocess.py +++ b/sface/sfiprocess.py @@ -23,6 +23,10 @@ class SfiProcess(QObject): self.process = QProcess() self.connect(self.process, SIGNAL("finished(int, QProcess::ExitStatus)"), self.processFinished) + self.connect(self.process, SIGNAL("readyReadStandardOutput()"), + self.processStandardOutput) + self.connect(self.process, SIGNAL("readyReadStandardError()"), + self.processStandardError) def __init_command(self, args): self.args = QStringList() @@ -36,6 +40,14 @@ class SfiProcess(QObject): def isRunning(self): return self.process.state() != QProcess.NotRunning + def processStandardOutput(self): + output = self.readAllStandardOutput() + if self.debug: + print output + + def processStandardError(self): + print self.process.readAllStandardError() + def processFinished(self): if self.process.exitStatus() == QProcess.CrashExit: print self.readOutput()