##// 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 Entry point for a simple application giving a graphical frontend to
3 Entry point for a simple application giving a graphical frontend to
3 ipython.
4 ipython.
@@ -12,7 +13,7 b' class IPythonXController(WxController):'
12 bindings.
13 bindings.
13 """
14 """
14
15
15 debug = True
16 debug = False
16
17
17 def __init__(self, *args, **kwargs):
18 def __init__(self, *args, **kwargs):
18 WxController.__init__(self, *args, **kwargs)
19 WxController.__init__(self, *args, **kwargs)
@@ -66,8 +67,20 b' class IPythonX(wx.Frame):'
66
67
67
68
68 def main():
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 app = wx.PySimpleApp()
81 app = wx.PySimpleApp()
70 frame = IPythonX(None, wx.ID_ANY, 'IPythonX')
82 frame = IPythonX(None, wx.ID_ANY, 'IPythonX')
83 frame.shell.debug = options.debug
71 frame.shell.SetFocus()
84 frame.shell.SetFocus()
72 frame.shell.app = app
85 frame.shell.app = app
73 frame.SetSize((680, 460))
86 frame.SetSize((680, 460))
@@ -72,7 +72,7 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
72 input_prompt_template = string.Template(prompt_in1)
72 input_prompt_template = string.Template(prompt_in1)
73
73
74 # Print debug info on what is happening to the console.
74 # Print debug info on what is happening to the console.
75 debug = True
75 debug = False
76
76
77 # The title of the terminal, as captured through the ANSI escape
77 # The title of the terminal, as captured through the ANSI escape
78 # sequences.
78 # sequences.
@@ -422,7 +422,6 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
422 if self.debug:
422 if self.debug:
423 print >>sys.__stdout__, repr(self.input_buffer)
423 print >>sys.__stdout__, repr(self.input_buffer)
424 PrefilterFrontEnd._on_enter(self)
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 def _colorize_input_buffer(self):
450 def _colorize_input_buffer(self):
452 """ Keep the input buffer lines at a bright color.
451 """ Keep the input buffer lines at a bright color.
453 """
452 """
453 if not self._input_state == 'readline':
454 return
454 end_line = self.GetCurrentLine() + 1
455 end_line = self.GetCurrentLine() + 1
455 for i in range(self.current_prompt_line, end_line):
456 for i in range(self.current_prompt_line, end_line):
456 if i in self._markers:
457 if i in self._markers:
General Comments 0
You need to be logged in to leave comments. Login now