##// END OF EJS Templates
Fix raw_input.
gvaroquaux -
Show More
@@ -192,7 +192,6 b' class ConsoleWidget(editwindow.EditWindow):'
192 # now we update our cursor giving end of prompt
192 # now we update our cursor giving end of prompt
193 self.current_prompt_pos = self.GetLength()
193 self.current_prompt_pos = self.GetLength()
194 self.current_prompt_line = self.GetCurrentLine()
194 self.current_prompt_line = self.GetCurrentLine()
195 wx.Yield()
196 self.EnsureCaretVisible()
195 self.EnsureCaretVisible()
197
196
198
197
@@ -144,6 +144,9 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
144 ConsoleWidget.__init__(self, parent, id, pos, size, style)
144 ConsoleWidget.__init__(self, parent, id, pos, size, style)
145 PrefilterFrontEnd.__init__(self, **kwds)
145 PrefilterFrontEnd.__init__(self, **kwds)
146
146
147 # Stick in our own raw_input:
148 self.ipython0.raw_input = self.raw_input
149
147 # Marker for complete buffer.
150 # Marker for complete buffer.
148 self.MarkerDefine(_COMPLETE_BUFFER_MARKER, stc.STC_MARK_BACKGROUND,
151 self.MarkerDefine(_COMPLETE_BUFFER_MARKER, stc.STC_MARK_BACKGROUND,
149 background=_COMPLETE_BUFFER_BG)
152 background=_COMPLETE_BUFFER_BG)
@@ -166,6 +169,8 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
166 # Inject self in namespace, for debug
169 # Inject self in namespace, for debug
167 if self.debug:
170 if self.debug:
168 self.shell.user_ns['self'] = self
171 self.shell.user_ns['self'] = self
172 # Inject our own raw_input in namespace
173 self.shell.user_ns['raw_input'] = self.raw_input
169
174
170
175
171 def raw_input(self, prompt):
176 def raw_input(self, prompt):
@@ -298,9 +303,9 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
298 PrefilterFrontEnd.save_output_hooks(self)
303 PrefilterFrontEnd.save_output_hooks(self)
299
304
300 def capture_output(self):
305 def capture_output(self):
301 __builtin__.raw_input = self.raw_input
302 self.SetLexer(stc.STC_LEX_NULL)
306 self.SetLexer(stc.STC_LEX_NULL)
303 PrefilterFrontEnd.capture_output(self)
307 PrefilterFrontEnd.capture_output(self)
308 __builtin__.raw_input = self.raw_input
304
309
305
310
306 def release_output(self):
311 def release_output(self):
General Comments 0
You need to be logged in to leave comments. Login now