X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Flogwindow.py;h=fd252ef6905c721844bb8439a54660ffb8dd1d8d;hp=c5c41dd1714cab4fd4714b719dd7a05384e41d1f;hb=a3763f36eadcbf488a72ba60a5c7f7da4ec6e2b3;hpb=8ec23b298e338e6005b7a4d12480cc06a38ec03e diff --git a/sface/logwindow.py b/sface/logwindow.py index c5c41dd..fd252ef 100644 --- a/sface/logwindow.py +++ b/sface/logwindow.py @@ -6,6 +6,8 @@ from PyQt4.QtGui import * from sface.config import config +import time + class LogIO(QObject): def __init__(self, parent, old_stdout): QObject.__init__(self, parent) @@ -17,7 +19,12 @@ class LogIO(QObject): self.parent().update() def getText(self): - return self.io.getvalue() + val = self.io.getvalue() + # looks like there is no other way + # to empty the StringIO + del self.io + self.io = StringIO() + return val class LogWindow(QDialog): def __init__(self, parent=None): @@ -40,10 +47,7 @@ class LogWindow(QDialog): sys.stderr = self.logio def update(self): - self.text.setText(self.logio.getText()) + self.text.insertPlainText(self.logio.getText()) c = self.text.textCursor() c.movePosition(QTextCursor.End) self.text.setTextCursor(c) - - -