git://git.onelab.eu
/
sface.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b208b6e
)
add trace functions back
author
Barış Metin
<Talip-Baris.Metin@sophia.inria.fr>
Thu, 9 Sep 2010 18:41:36 +0000
(20:41 +0200)
committer
Barış Metin
<Talip-Baris.Metin@sophia.inria.fr>
Thu, 9 Sep 2010 18:41:36 +0000
(20:41 +0200)
sface/sfiprocess.py
patch
|
blob
|
history
diff --git
a/sface/sfiprocess.py
b/sface/sfiprocess.py
index
d39bd75
..
27c5b7c
100644
(file)
--- a/
sface/sfiprocess.py
+++ b/
sface/sfiprocess.py
@@
-1,5
+1,7
@@
import os
import os
+import time
+
from PyQt4.QtCore import *
from sface.sficonfig import config
from PyQt4.QtCore import *
from sface.sficonfig import config
@@
-29,6
+31,7
@@
class SfiProcess(QObject):
self.processFinished)
def processFinished(self):
self.processFinished)
def processFinished(self):
+ self.trace_end()
self.emit(SIGNAL("finished()"))
def __getRSpec(self, mgr):
self.emit(SIGNAL("finished()"))
def __getRSpec(self, mgr):
@@
-60,9
+63,20
@@
class SfiProcess(QObject):
self.start()
def start(self):
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()
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'