##// END OF EJS Templates
Apply the same hack used for raw_input to system calls.
gvaroquaux -
Show More
@@ -196,16 +196,18 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
196
196
197 def system_call(self, command_string):
197 def system_call(self, command_string):
198 self._input_state = 'subprocess'
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 self._running_process = PipedProcess(command_string,
205 self._running_process = PipedProcess(command_string,
200 out_callback=self.buffered_write,
206 out_callback=self.buffered_write,
201 end_callback = self._end_system_call)
207 end_callback = _end_system_call)
202 self._running_process.start()
208 self._running_process.start()
203 # XXX: another one of these polling loops to have a blocking
209 # XXX: Running a separate event_loop. Ugly.
204 # call
210 event_loop.Run()
205 wx.Yield()
206 while self._running_process:
207 wx.Yield()
208 sleep(0.1)
209 # Be sure to flush the buffer.
211 # Be sure to flush the buffer.
210 self._buffer_flush(event=None)
212 self._buffer_flush(event=None)
211
213
@@ -476,13 +478,6 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
476 # Private API
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 def _buffer_flush(self, event):
481 def _buffer_flush(self, event):
487 """ Called by the timer to flush the write buffer.
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