##// END OF EJS Templates
BUG: Fix minor frontend bugs
Gael Varoquaux -
Show More
@@ -22,9 +22,9 b' __docformat__ = "restructuredtext en"'
22 # Imports
22 # Imports
23 #-------------------------------------------------------------------------------
23 #-------------------------------------------------------------------------------
24 import sys
24 import sys
25
25 import pydoc
26 from linefrontendbase import LineFrontEndBase, common_prefix
26 import os
27 from frontendbase import FrontEndBase
27 import __builtin__
28
28
29 from IPython.ipmaker import make_IPython
29 from IPython.ipmaker import make_IPython
30 from IPython.ipapi import IPApi
30 from IPython.ipapi import IPApi
@@ -33,9 +33,8 b' from IPython.kernel.core.redirector_output_trap import RedirectorOutputTrap'
33 from IPython.kernel.core.sync_traceback_trap import SyncTracebackTrap
33 from IPython.kernel.core.sync_traceback_trap import SyncTracebackTrap
34
34
35 from IPython.genutils import Term
35 from IPython.genutils import Term
36 import pydoc
36
37 import os
37 from linefrontendbase import LineFrontEndBase, common_prefix
38 import sys
39
38
40
39
41 def mk_system_call(system_call_function, command):
40 def mk_system_call(system_call_function, command):
@@ -85,10 +84,16 b' class PrefilterFrontEnd(LineFrontEndBase):'
85 if ipython0 is None:
84 if ipython0 is None:
86 # Instanciate an IPython0 interpreter to be able to use the
85 # Instanciate an IPython0 interpreter to be able to use the
87 # prefiltering.
86 # prefiltering.
87 # Suppress all key input, to avoid waiting
88 def my_rawinput(x=None):
89 return '\n'
90 old_rawinput = __builtin__.raw_input
91 __builtin__.raw_input = my_rawinput
88 # XXX: argv=[] is a bit bold.
92 # XXX: argv=[] is a bit bold.
89 ipython0 = make_IPython(argv=[],
93 ipython0 = make_IPython(argv=[],
90 user_ns=self.shell.user_ns,
94 user_ns=self.shell.user_ns,
91 user_global_ns=self.shell.user_global_ns)
95 user_global_ns=self.shell.user_global_ns)
96 __builtin__.raw_input = old_rawinput
92 self.ipython0 = ipython0
97 self.ipython0 = ipython0
93 # Set the pager:
98 # Set the pager:
94 self.ipython0.set_hook('show_in_pager',
99 self.ipython0.set_hook('show_in_pager',
@@ -100,6 +105,7 b' class PrefilterFrontEnd(LineFrontEndBase):'
100 self._ip.system = self.system_call
105 self._ip.system = self.system_call
101 # XXX: Muck around with magics so that they work better
106 # XXX: Muck around with magics so that they work better
102 # in our environment
107 # in our environment
108 if not sys.platform.startswith('win'):
103 self.ipython0.magic_ls = mk_system_call(self.system_call,
109 self.ipython0.magic_ls = mk_system_call(self.system_call,
104 'ls -CF')
110 'ls -CF')
105 # And now clean up the mess created by ipython0
111 # And now clean up the mess created by ipython0
General Comments 0
You need to be logged in to leave comments. Login now