X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Flogwindow.py;h=fd252ef6905c721844bb8439a54660ffb8dd1d8d;hp=c5c41dd1714cab4fd4714b719dd7a05384e41d1f;hb=1f6518cd217d99df1031b53bab151eadca45d0ab;hpb=4ab45a38d53566d12bc64403bf9b7c19108eb286 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) - - -