Show More
@@ -154,13 +154,18 b' class NonBlockingIPShell(object):' | |||||
154 | self._term = IPython.genutils.IOTerm(cin=cin, cout=cout, cerr=cerr) |
|
154 | self._term = IPython.genutils.IOTerm(cin=cin, cout=cout, cerr=cerr) | |
155 |
|
155 | |||
156 | excepthook = sys.excepthook |
|
156 | excepthook = sys.excepthook | |
157 |
|
157 | #Hack to save sys.displayhook, because ipython seems to overwrite it... | ||
|
158 | self.sys_displayhook_ori = sys.displayhook | |||
|
159 | ||||
158 | self._IP = IPython.Shell.make_IPython( |
|
160 | self._IP = IPython.Shell.make_IPython( | |
159 | argv,user_ns=user_ns, |
|
161 | argv,user_ns=user_ns, | |
160 | user_global_ns=user_global_ns, |
|
162 | user_global_ns=user_global_ns, | |
161 | embedded=True, |
|
163 | embedded=True, | |
162 | shell_class=IPython.Shell.InteractiveShell) |
|
164 | shell_class=IPython.Shell.InteractiveShell) | |
163 |
|
165 | |||
|
166 | #we restore sys.displayhook | |||
|
167 | sys.displayhook = self.sys_displayhook_ori | |||
|
168 | ||||
164 | #we replace IPython default encoding by wx locale encoding |
|
169 | #we replace IPython default encoding by wx locale encoding | |
165 | loc = locale.getpreferredencoding() |
|
170 | loc = locale.getpreferredencoding() | |
166 | if loc: |
|
171 | if loc: | |
@@ -195,8 +200,9 b' class NonBlockingIPShell(object):' | |||||
195 |
|
200 | |||
196 | self._line_to_execute = line |
|
201 | self._line_to_execute = line | |
197 | #we launch the ipython line execution in a thread to make it interruptible |
|
202 | #we launch the ipython line execution in a thread to make it interruptible | |
198 | ce = _CodeExecutor(self, self._afterExecute) |
|
203 | #with include it in self namespace to be able to call ce.raise_exc(KeyboardInterrupt) | |
199 | ce.start() |
|
204 | self.ce = _CodeExecutor(self, self._afterExecute) | |
|
205 | self.ce.start() | |||
200 |
|
206 | |||
201 | #----------------------- IPython management section ---------------------- |
|
207 | #----------------------- IPython management section ---------------------- | |
202 | def getDocText(self): |
|
208 | def getDocText(self): |
General Comments 0
You need to be logged in to leave comments.
Login now