Show More
@@ -168,7 +168,9 class ConsoleWidget(editwindow.EditWindow): | |||
|
168 | 168 | |
|
169 | 169 | self.GotoPos(self.GetLength()) |
|
170 | 170 | if refresh: |
|
171 | wx.Yield() | |
|
171 | # Maybe this is faster than wx.Yield() | |
|
172 | self.ProcessEvent(wx.PaintEvent()) | |
|
173 | #wx.Yield() | |
|
172 | 174 | |
|
173 | 175 | |
|
174 | 176 | def new_prompt(self, prompt): |
@@ -206,6 +208,15 class ConsoleWidget(editwindow.EditWindow): | |||
|
206 | 208 | """ |
|
207 | 209 | return self.GetSize()[0]/self.GetCharWidth() |
|
208 | 210 | |
|
211 | #-------------------------------------------------------------------------- | |
|
212 | # EditWindow API | |
|
213 | #-------------------------------------------------------------------------- | |
|
214 | ||
|
215 | def OnUpdateUI(self, event): | |
|
216 | """ Override the OnUpdateUI of the EditWindow class, to prevent | |
|
217 | syntax highlighting both for faster redraw, and for more | |
|
218 | consistent look and feel. | |
|
219 | """ | |
|
209 | 220 | |
|
210 | 221 | #-------------------------------------------------------------------------- |
|
211 | 222 | # Private API |
@@ -264,7 +264,8 class WxController(ConsoleWidget, PrefilterFrontEnd): | |||
|
264 | 264 | self._out_buffer.append(text) |
|
265 | 265 | self._out_buffer_lock.release() |
|
266 | 266 | if not self._buffer_flush_timer.IsRunning(): |
|
267 |
wx.CallAfter(self._buffer_flush_timer.Start, |
|
|
267 | wx.CallAfter(self._buffer_flush_timer.Start, | |
|
268 | milliseconds=100, oneShot=True) | |
|
268 | 269 | |
|
269 | 270 | |
|
270 | 271 | #-------------------------------------------------------------------------- |
@@ -294,12 +295,14 class WxController(ConsoleWidget, PrefilterFrontEnd): | |||
|
294 | 295 | |
|
295 | 296 | def capture_output(self): |
|
296 | 297 | __builtin__.raw_input = self.raw_input |
|
298 | self.SetLexer(stc.STC_LEX_NULL) | |
|
297 | 299 | PrefilterFrontEnd.capture_output(self) |
|
298 | 300 | |
|
299 | 301 | |
|
300 | 302 | def release_output(self): |
|
301 | 303 | __builtin__.raw_input = self.__old_raw_input |
|
302 | 304 | PrefilterFrontEnd.release_output(self) |
|
305 | self.SetLexer(stc.STC_LEX_PYTHON) | |
|
303 | 306 | |
|
304 | 307 | |
|
305 | 308 | def after_execute(self): |
@@ -438,6 +441,18 class WxController(ConsoleWidget, PrefilterFrontEnd): | |||
|
438 | 441 | |
|
439 | 442 | |
|
440 | 443 | #-------------------------------------------------------------------------- |
|
444 | # EditWindow API | |
|
445 | #-------------------------------------------------------------------------- | |
|
446 | ||
|
447 | def OnUpdateUI(self, event): | |
|
448 | """ Override the OnUpdateUI of the EditWindow class, to prevent | |
|
449 | syntax highlighting both for faster redraw, and for more | |
|
450 | consistent look and feel. | |
|
451 | """ | |
|
452 | if not self._input_state == 'readline': | |
|
453 | ConsoleWidget.OnUpdateUI(self, event) | |
|
454 | ||
|
455 | #-------------------------------------------------------------------------- | |
|
441 | 456 | # Private API |
|
442 | 457 | #-------------------------------------------------------------------------- |
|
443 | 458 | |
@@ -458,7 +473,7 class WxController(ConsoleWidget, PrefilterFrontEnd): | |||
|
458 | 473 | self._out_buffer = [] |
|
459 | 474 | self._out_buffer_lock.release() |
|
460 | 475 | self.write(''.join(_out_buffer), refresh=False) |
|
461 | self._buffer_flush_timer.Stop() | |
|
476 | ||
|
462 | 477 | |
|
463 | 478 | def _colorize_input_buffer(self): |
|
464 | 479 | """ Keep the input buffer lines at a bright color. |
General Comments 0
You need to be logged in to leave comments.
Login now