990 self.__blockTextProcessing = True |
990 self.__blockTextProcessing = True |
991 # Get all text which is still waiting for output |
991 # Get all text which is still waiting for output |
992 QApplication.processEvents() |
992 QApplication.processEvents() |
993 |
993 |
994 # Finally process the accumulated text |
994 # Finally process the accumulated text |
|
995 self.__flushQueuedText() |
|
996 |
|
997 def __flushQueuedText(self): |
|
998 """ |
|
999 Private slot to flush the accumulated text output. |
|
1000 """ |
995 self.__write(self.__queuedText) |
1001 self.__write(self.__queuedText) |
996 |
1002 |
997 self.__queuedText = '' |
1003 self.__queuedText = '' |
998 self.__blockTextProcessing = False |
1004 self.__blockTextProcessing = False |
999 |
1005 |
1000 # little trick to get the cursor position registered within QScintilla |
1006 # little trick to get the cursor position registered within QScintilla |
1001 self.SendScintilla(QsciScintilla.SCI_CHARLEFT) |
1007 self.SendScintilla(QsciScintilla.SCI_CHARLEFT) |
1002 self.SendScintilla(QsciScintilla.SCI_CHARRIGHT) |
1008 self.SendScintilla(QsciScintilla.SCI_CHARRIGHT) |
1003 |
1009 |
1004 def __write(self, s): |
1010 def __write(self, s): |
1005 """ |
1011 """ |
1006 Private method to display some text without queuing. |
1012 Private method to display some text without queuing. |
1007 |
1013 |
1008 @param s text to be displayed |
1014 @param s text to be displayed |
1029 |
1035 |
1030 @param s text to be displayed (string) |
1036 @param s text to be displayed (string) |
1031 """ |
1037 """ |
1032 self.__write(self.tr("StdErr: {0}").format(s)) |
1038 self.__write(self.tr("StdErr: {0}").format(s)) |
1033 |
1039 |
1034 def __raw_input(self, s, echo): |
1040 def __raw_input(self, prompt, echo): |
1035 """ |
1041 """ |
1036 Private method to handle raw input. |
1042 Private method to handle raw input. |
1037 |
1043 |
1038 @param s prompt to be displayed (string) |
1044 @param prompt prompt to be displayed |
1039 @param echo Flag indicating echoing of the input (boolean) |
1045 @type str |
1040 """ |
1046 @param echo Flag indicating echoing of the input |
1041 # Get all text which is still waiting for output |
1047 @type bool |
1042 QApplication.processEvents() |
1048 """ |
1043 |
|
1044 self.setFocus() |
1049 self.setFocus() |
1045 self.inRawMode = True |
1050 self.inRawMode = True |
1046 self.echoInput = echo |
1051 self.echoInput = echo |
1047 self.__writeQueued(s) |
1052 |
|
1053 # Get all text which is still waiting for output |
|
1054 QApplication.processEvents() |
|
1055 self.__flushQueuedText() |
|
1056 |
|
1057 self.__write(prompt) |
1048 line, col = self.__getEndPos() |
1058 line, col = self.__getEndPos() |
1049 self.setCursorPosition(line, col) |
1059 self.setCursorPosition(line, col) |
1050 buf = self.text(line) |
1060 buf = self.text(line) |
1051 if buf.startswith(sys.ps1): |
1061 if buf.startswith(sys.ps1): |
1052 buf = buf.replace(sys.ps1, "") |
1062 buf = buf.replace(sys.ps1, "") |