X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fsfiprocess.py;h=27c5b7c2bba25f773e86f8dea3a7bf32d0e69d92;hp=d39bd756cfe5b06b40937064eaa8a4ef738f054e;hb=051854b5d800bc58865f68aafbebe02370a26860;hpb=b208b6e7ec80af977a3301e73f54d5e3326b94d4 diff --git a/sface/sfiprocess.py b/sface/sfiprocess.py index d39bd75..27c5b7c 100644 --- a/sface/sfiprocess.py +++ b/sface/sfiprocess.py @@ -1,5 +1,7 @@ import os +import time + from PyQt4.QtCore import * from sface.sficonfig import config @@ -29,6 +31,7 @@ class SfiProcess(QObject): self.processFinished) def processFinished(self): + self.trace_end() self.emit(SIGNAL("finished()")) def __getRSpec(self, mgr): @@ -60,9 +63,20 @@ class SfiProcess(QObject): self.start() def start(self): + self.trace_command() self.process.start(self.exe, self.args) def readOutput(self): if self.process.state() == QProcess.NotRunning: return self.process.readAll() + def trace_command (self): + if config.SFACE_VERBOSE: + self._trace=time.time() + command = "%s %s" % (self.exe, self.args.join(" ")) + print time.strftime('%M:%S'),'Invoking',command + + def trace_end (self): + if config.SFACE_VERBOSE: + command = "%s %s" % (self.exe, self.args.join(" ")) + print time.strftime('%M:%S'),"[%.3f s]"%(time.time()-self._trace),command,'Done'