##// END OF EJS Templates
Tweak the debug mode....
gvaroquaux -
Show More
@@ -66,7 +66,7 b' class LineFrontEndBase(FrontEndBase):'
66 66 # FrontEndBase interface
67 67 #--------------------------------------------------------------------------
68 68
69 def __init__(self, shell=None, history=None):
69 def __init__(self, shell=None, history=None, *args, **kwargs):
70 70 if shell is None:
71 71 shell = Interpreter()
72 72 FrontEndBase.__init__(self, shell=shell, history=history)
@@ -66,10 +66,10 b' class IPythonX(wx.Frame):'
66 66 """ Main frame of the IPythonX app.
67 67 """
68 68
69 def __init__(self, parent, id, title):
69 def __init__(self, parent, id, title, debug=False):
70 70 wx.Frame.__init__(self, parent, id, title, size=(300,250))
71 71 self._sizer = wx.BoxSizer(wx.VERTICAL)
72 self.shell = IPythonXController(self)
72 self.shell = IPythonXController(self, debug=debug)
73 73 self._sizer.Add(self.shell, 1, wx.EXPAND)
74 74 self.SetSizer(self._sizer)
75 75 self.SetAutoLayout(1)
@@ -93,8 +93,7 b' Simple graphical frontend to IPython, using WxWidgets."""'
93 93 sys.argv = sys.argv[:1]
94 94
95 95 app = wx.PySimpleApp()
96 frame = IPythonX(None, wx.ID_ANY, 'IPythonX')
97 frame.shell.debug = options.debug
96 frame = IPythonX(None, wx.ID_ANY, 'IPythonX', debug=options.debug)
98 97 frame.shell.SetFocus()
99 98 frame.shell.app = app
100 99 frame.SetSize((680, 460))
@@ -140,7 +140,7 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
140 140 """ Create Shell instance.
141 141 """
142 142 ConsoleWidget.__init__(self, parent, id, pos, size, style)
143 PrefilterFrontEnd.__init__(self)
143 PrefilterFrontEnd.__init__(self, **kwds)
144 144
145 145 # Marker for complete buffer.
146 146 self.MarkerDefine(_COMPLETE_BUFFER_MARKER, stc.STC_MARK_BACKGROUND,
@@ -157,6 +157,10 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
157 157 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID)
158 158 wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush)
159 159
160 if 'debug' in kwds:
161 self.debug = kwds['debug']
162 kwds.pop('debug')
163
160 164 # Inject self in namespace, for debug
161 165 if self.debug:
162 166 self.shell.user_ns['self'] = self
@@ -167,6 +171,8 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
167 171 """
168 172 self.new_prompt(prompt)
169 173 self._input_state = 'raw_input'
174 del self._cursor
175 self.SetCursor(wx.StockCursor(wx.CURSOR_CROSS))
170 176 self.waiting = True
171 177 self.__old_on_enter = self._on_enter
172 178 def my_on_enter():
@@ -178,6 +184,7 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
178 184 sleep(0.1)
179 185 self._on_enter = self.__old_on_enter
180 186 self._input_state = 'buffering'
187 self._cursor = wx.BusyCursor()
181 188 return self.input_buffer.rstrip('\n')
182 189
183 190
@@ -214,9 +221,9 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
214 221 symbol = __builtin__.__dict__[base_symbol_string]
215 222 else:
216 223 return False
217 for name in symbol_string.split('.')[1:] + ['__doc__']:
218 symbol = getattr(symbol, name)
219 224 try:
225 for name in symbol_string.split('.')[1:] + ['__doc__']:
226 symbol = getattr(symbol, name)
220 227 self.AutoCompCancel()
221 228 wx.Yield()
222 229 self.CallTipShow(self.GetCurrentPos(), symbol)
@@ -299,6 +306,7 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
299 306 # Clear the wait cursor
300 307 if hasattr(self, '_cursor'):
301 308 del self._cursor
309 self.SetCursor(wx.StockCursor(wx.CURSOR_CHAR))
302 310
303 311
304 312 def show_traceback(self):
General Comments 0
You need to be logged in to leave comments. Login now