Show More
@@ -196,16 +196,18 b' class WxController(ConsoleWidget, PrefilterFrontEnd):' | |||
|
196 | 196 | |
|
197 | 197 | def system_call(self, command_string): |
|
198 | 198 | self._input_state = 'subprocess' |
|
199 | event_loop = wx.EventLoop() | |
|
200 | def _end_system_call(): | |
|
201 | self._input_state = 'buffering' | |
|
202 | self._running_process = False | |
|
203 | event_loop.Exit() | |
|
204 | ||
|
199 | 205 | self._running_process = PipedProcess(command_string, |
|
200 | 206 | out_callback=self.buffered_write, |
|
201 |
end_callback = |
|
|
207 | end_callback = _end_system_call) | |
|
202 | 208 | self._running_process.start() |
|
203 | # XXX: another one of these polling loops to have a blocking | |
|
204 | # call | |
|
205 | wx.Yield() | |
|
206 | while self._running_process: | |
|
207 | wx.Yield() | |
|
208 | sleep(0.1) | |
|
209 | # XXX: Running a separate event_loop. Ugly. | |
|
210 | event_loop.Run() | |
|
209 | 211 | # Be sure to flush the buffer. |
|
210 | 212 | self._buffer_flush(event=None) |
|
211 | 213 | |
@@ -476,13 +478,6 b' class WxController(ConsoleWidget, PrefilterFrontEnd):' | |||
|
476 | 478 | # Private API |
|
477 | 479 | #-------------------------------------------------------------------------- |
|
478 | 480 | |
|
479 | def _end_system_call(self): | |
|
480 | """ Called at the end of a system call. | |
|
481 | """ | |
|
482 | self._input_state = 'buffering' | |
|
483 | self._running_process = False | |
|
484 | ||
|
485 | ||
|
486 | 481 | def _buffer_flush(self, event): |
|
487 | 482 | """ Called by the timer to flush the write buffer. |
|
488 | 483 |
General Comments 0
You need to be logged in to leave comments.
Login now