Show More
@@ -138,10 +138,14 class LineFrontEndBase(FrontEndBase): | |||||
138 | return FrontEndBase.is_complete(self, string.rstrip() + '\n\n') |
|
138 | return FrontEndBase.is_complete(self, string.rstrip() + '\n\n') | |
139 |
|
139 | |||
140 |
|
140 | |||
141 | def write(self, string): |
|
141 | def write(self, string, refresh=True): | |
142 | """ Write some characters to the display. |
|
142 | """ Write some characters to the display. | |
143 |
|
143 | |||
144 | Subclass should overide this method. |
|
144 | Subclass should overide this method. | |
|
145 | ||||
|
146 | The refresh keyword argument is used in frontends with an | |||
|
147 | event loop, to choose whether the write should trigget an UI | |||
|
148 | refresh, and thus be syncrhonous, or not. | |||
145 | """ |
|
149 | """ | |
146 | print >>sys.__stderr__, string |
|
150 | print >>sys.__stderr__, string | |
147 |
|
151 |
@@ -337,7 +337,7 class ConsoleWidget(editwindow.EditWindow): | |||||
337 | event.Modifiers in (wx.MOD_NONE, wx.MOD_WIN): |
|
337 | event.Modifiers in (wx.MOD_NONE, wx.MOD_WIN): | |
338 | catched = True |
|
338 | catched = True | |
339 | self.CallTipCancel() |
|
339 | self.CallTipCancel() | |
340 | self.write('\n') |
|
340 | self.write('\n', refresh=False) | |
341 | # Under windows scintilla seems to be doing funny stuff to the |
|
341 | # Under windows scintilla seems to be doing funny stuff to the | |
342 | # line returns here, but the getter for input_buffer filters |
|
342 | # line returns here, but the getter for input_buffer filters | |
343 | # this out. |
|
343 | # this out. |
@@ -42,13 +42,14 class IPythonXController(WxController): | |||||
42 | def ask_exit(self): |
|
42 | def ask_exit(self): | |
43 | """ Ask the user whether to exit. |
|
43 | """ Ask the user whether to exit. | |
44 | """ |
|
44 | """ | |
45 | self.write('\n') |
|
45 | self._input_state = 'subprocess' | |
|
46 | self.write('\n', refresh=False) | |||
46 | self.capture_output() |
|
47 | self.capture_output() | |
47 | self.ipython0.shell.exit() |
|
48 | self.ipython0.shell.exit() | |
48 | self.release_output() |
|
49 | self.release_output() | |
49 | wx.Yield() |
|
|||
50 | if not self.ipython0.exit_now: |
|
50 | if not self.ipython0.exit_now: | |
51 | self.new_prompt(self.input_prompt_template.substitute( |
|
51 | wx.CallAfter(self.new_prompt, | |
|
52 | self.input_prompt_template.substitute( | |||
52 | number=self.last_result['number'] + 1)) |
|
53 | number=self.last_result['number'] + 1)) | |
53 |
|
54 | |||
54 |
|
55 | |||
@@ -87,6 +88,10 Simple graphical frontend to IPython, using WxWidgets.""" | |||||
87 |
|
88 | |||
88 | options, args = parser.parse_args() |
|
89 | options, args = parser.parse_args() | |
89 |
|
90 | |||
|
91 | # Clear the options, to avoid having the ipython0 instance complain | |||
|
92 | import sys | |||
|
93 | sys.argv = sys.argv[:1] | |||
|
94 | ||||
90 | app = wx.PySimpleApp() |
|
95 | app = wx.PySimpleApp() | |
91 | frame = IPythonX(None, wx.ID_ANY, 'IPythonX') |
|
96 | frame = IPythonX(None, wx.ID_ANY, 'IPythonX') | |
92 | frame.shell.debug = options.debug |
|
97 | frame.shell.debug = options.debug |
@@ -90,7 +90,6 class WxController(ConsoleWidget, PrefilterFrontEnd): | |||||
90 | # inheritence |
|
90 | # inheritence | |
91 | def _set_input_buffer(self, string): |
|
91 | def _set_input_buffer(self, string): | |
92 | ConsoleWidget._set_input_buffer(self, string) |
|
92 | ConsoleWidget._set_input_buffer(self, string) | |
93 | wx.Yield() |
|
|||
94 | self._colorize_input_buffer() |
|
93 | self._colorize_input_buffer() | |
95 |
|
94 | |||
96 | def _get_input_buffer(self): |
|
95 | def _get_input_buffer(self): |
General Comments 0
You need to be logged in to leave comments.
Login now