##// END OF EJS Templates
Minimal fixes so ipython-wx runs....
Fernando Perez -
Show More
@@ -23,13 +23,9 b' import os'
23 23 import locale
24 24 from thread_ex import ThreadEx
25 25
26 try:
27 import IPython
28 from IPython.utils import genutils
29 from IPython.core import iplib
30 except Exception,e:
31 print "Error importing IPython (%s)" % str(e)
32 raise Exception, e
26 import IPython
27 from IPython.core import iplib, ipapp
28 from IPython.utils import genutils
33 29
34 30 ##############################################################################
35 31 class _Helper(object):
@@ -155,12 +151,17 b' class NonBlockingIPShell(object):'
155 151
156 152 #Hack to save sys.displayhook, because ipython seems to overwrite it...
157 153 self.sys_displayhook_ori = sys.displayhook
154
155 ipython0 = ipapp.IPythonApp(argv,user_ns=user_ns,
156 user_global_ns=user_global_ns)
157 ipython0.initialize()
158 self._IP = ipython0.shell
158 159
159 self._IP = IPython.shell.make_IPython(
160 argv,user_ns=user_ns,
161 user_global_ns=user_global_ns,
162 embedded=True,
163 shell_class=IPython.shell.InteractiveShell)
160 ## self._IP = IPython.shell.make_IPython(
161 ## argv,user_ns=user_ns,
162 ## user_global_ns=user_global_ns,
163 ## embedded=True,
164 ## shell_class=IPython.shell.InteractiveShell)
164 165
165 166 #we save ipython0 displayhook and we restore sys.displayhook
166 167 self.displayhook = sys.displayhook
@@ -273,7 +274,7 b' class NonBlockingIPShell(object):'
273 274 @return: The banner string.
274 275 @rtype: string
275 276 """
276 return self._IP.BANNER
277 return self._IP.banner
277 278
278 279 def get_prompt_count(self):
279 280 """
@@ -470,7 +471,7 b' class NonBlockingIPShell(object):'
470 471 '''
471 472
472 473 orig_stdout = sys.stdout
473 sys.stdout = IPython.shell.Term.cout
474 sys.stdout = genutils.Term.cout
474 475 #self.sys_displayhook_ori = sys.displayhook
475 476 #sys.displayhook = self.displayhook
476 477
General Comments 0
You need to be logged in to leave comments. Login now