##// END OF EJS Templates
Clean up the test application for the wx frontend.
gvaroquaux -
Show More
@@ -1,3 +1,4 b''
1 #!/usr/bin/env python
1 2 """
2 3 Entry point for a simple application giving a graphical frontend to
3 4 ipython.
@@ -12,7 +13,7 b' class IPythonXController(WxController):'
12 13 bindings.
13 14 """
14 15
15 debug = True
16 debug = False
16 17
17 18 def __init__(self, *args, **kwargs):
18 19 WxController.__init__(self, *args, **kwargs)
@@ -66,8 +67,20 b' class IPythonX(wx.Frame):'
66 67
67 68
68 69 def main():
70 from optparse import OptionParser
71 usage = """usage: %prog [options]
72
73 Simple graphical frontend to IPython, using WxWidgets."""
74 parser = OptionParser(usage=usage)
75 parser.add_option("-d", "--debug",
76 action="store_true", dest="debug", default=False,
77 help="Enable debug message for the wx frontend.")
78
79 options, args = parser.parse_args()
80
69 81 app = wx.PySimpleApp()
70 82 frame = IPythonX(None, wx.ID_ANY, 'IPythonX')
83 frame.shell.debug = options.debug
71 84 frame.shell.SetFocus()
72 85 frame.shell.app = app
73 86 frame.SetSize((680, 460))
@@ -72,7 +72,7 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
72 72 input_prompt_template = string.Template(prompt_in1)
73 73
74 74 # Print debug info on what is happening to the console.
75 debug = True
75 debug = False
76 76
77 77 # The title of the terminal, as captured through the ANSI escape
78 78 # sequences.
@@ -422,7 +422,6 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
422 422 if self.debug:
423 423 print >>sys.__stdout__, repr(self.input_buffer)
424 424 PrefilterFrontEnd._on_enter(self)
425 #self._colorize_input_buffer()
426 425
427 426
428 427 #--------------------------------------------------------------------------
@@ -451,6 +450,8 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
451 450 def _colorize_input_buffer(self):
452 451 """ Keep the input buffer lines at a bright color.
453 452 """
453 if not self._input_state == 'readline':
454 return
454 455 end_line = self.GetCurrentLine() + 1
455 456 for i in range(self.current_prompt_line, end_line):
456 457 if i in self._markers:
General Comments 0
You need to be logged in to leave comments. Login now