+ self.logio = LogIO(self, sys.stdout)
+
+ def redirectOutput(self):
+ print "\n\nRedirecting all output to Log Window. Please open the log window to see the output\n"
+ self.old_stdout = sys.stdout
+ self.old_stderr = sys.stderr
+ sys.stdout = self.logio
+ sys.stderr = self.logio
+
+ def update(self):
+ #starttime = time.time()
+ #self.logio.old_stdout.write("update: entering\n")#.flush()
+ #self.logio.old_stdout.write('one\n')#.flush()
+ self.text.insertPlainText(self.logio.getText())
+ #self.logio.old_stdout.write('two\n')#.flush()
+ c = self.text.textCursor()
+ #self.logio.old_stdout.write('three\n')#.flush()
+ c.movePosition(QTextCursor.End)
+ #self.logio.old_stdout.write('four\n')#.flush()
+ self.text.setTextCursor(c)
+ #self.logio.old_stdout.write('five\n')#.flush()
+ #self.logio.old_stdout.write("update: done \n")# + time.strftime(('%M:%S'),"[%.3f s]"%(time.time() - starttime)))#.flush()