Show More
@@ -23,13 +23,9 b' import os' | |||||
23 | import locale |
|
23 | import locale | |
24 | from thread_ex import ThreadEx |
|
24 | from thread_ex import ThreadEx | |
25 |
|
25 | |||
26 | try: |
|
26 | import IPython | |
27 | import IPython |
|
27 | from IPython.core import iplib, ipapp | |
28 |
|
|
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 |
|
|||
33 |
|
29 | |||
34 | ############################################################################## |
|
30 | ############################################################################## | |
35 | class _Helper(object): |
|
31 | class _Helper(object): | |
@@ -155,12 +151,17 b' class NonBlockingIPShell(object):' | |||||
155 |
|
151 | |||
156 | #Hack to save sys.displayhook, because ipython seems to overwrite it... |
|
152 | #Hack to save sys.displayhook, because ipython seems to overwrite it... | |
157 | self.sys_displayhook_ori = sys.displayhook |
|
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 | ## self._IP = IPython.shell.make_IPython( | |
160 | argv,user_ns=user_ns, |
|
161 | ## argv,user_ns=user_ns, | |
161 | user_global_ns=user_global_ns, |
|
162 | ## user_global_ns=user_global_ns, | |
162 | embedded=True, |
|
163 | ## embedded=True, | |
163 | shell_class=IPython.shell.InteractiveShell) |
|
164 | ## shell_class=IPython.shell.InteractiveShell) | |
164 |
|
165 | |||
165 | #we save ipython0 displayhook and we restore sys.displayhook |
|
166 | #we save ipython0 displayhook and we restore sys.displayhook | |
166 | self.displayhook = sys.displayhook |
|
167 | self.displayhook = sys.displayhook | |
@@ -273,7 +274,7 b' class NonBlockingIPShell(object):' | |||||
273 | @return: The banner string. |
|
274 | @return: The banner string. | |
274 | @rtype: string |
|
275 | @rtype: string | |
275 | """ |
|
276 | """ | |
276 |
return self._IP. |
|
277 | return self._IP.banner | |
277 |
|
278 | |||
278 | def get_prompt_count(self): |
|
279 | def get_prompt_count(self): | |
279 | """ |
|
280 | """ | |
@@ -470,7 +471,7 b' class NonBlockingIPShell(object):' | |||||
470 | ''' |
|
471 | ''' | |
471 |
|
472 | |||
472 | orig_stdout = sys.stdout |
|
473 | orig_stdout = sys.stdout | |
473 |
sys.stdout = |
|
474 | sys.stdout = genutils.Term.cout | |
474 | #self.sys_displayhook_ori = sys.displayhook |
|
475 | #self.sys_displayhook_ori = sys.displayhook | |
475 | #sys.displayhook = self.displayhook |
|
476 | #sys.displayhook = self.displayhook | |
476 |
|
477 |
General Comments 0
You need to be logged in to leave comments.
Login now