##// END OF EJS Templates
Switch embedded IPython over to prompt_toolkit shell...
Thomas Kluyver -
Show More
@@ -15,7 +15,7 b' from IPython.core import ultratb, compilerop'
15 from IPython.core.magic import Magics, magics_class, line_magic
15 from IPython.core.magic import Magics, magics_class, line_magic
16 from IPython.core.interactiveshell import DummyMod
16 from IPython.core.interactiveshell import DummyMod
17 from IPython.core.interactiveshell import InteractiveShell
17 from IPython.core.interactiveshell import InteractiveShell
18 from IPython.terminal.interactiveshell import TerminalInteractiveShell
18 from IPython.terminal.ptshell import TerminalInteractiveShell
19 from IPython.terminal.ipapp import load_default_config
19 from IPython.terminal.ipapp import load_default_config
20
20
21 from traitlets import Bool, CBool, Unicode
21 from traitlets import Bool, CBool, Unicode
@@ -136,6 +136,9 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
136 else:
136 else:
137 self.old_banner2 = ''
137 self.old_banner2 = ''
138
138
139 if self.display_banner:
140 self.show_banner()
141
139 # Call the embedding code with a stack depth of 1 so it can skip over
142 # Call the embedding code with a stack depth of 1 so it can skip over
140 # our call and get the original caller's namespaces.
143 # our call and get the original caller's namespaces.
141 self.mainloop(local_ns, module, stack_depth=stack_depth,
144 self.mainloop(local_ns, module, stack_depth=stack_depth,
@@ -182,6 +185,9 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
182 module = DummyMod()
185 module = DummyMod()
183 module.__dict__ = global_ns
186 module.__dict__ = global_ns
184
187
188 if (display_banner is not None):
189 warnings.warn("The display_banner parameter is deprecated.", DeprecationWarning)
190
185 # Get locals and globals from caller
191 # Get locals and globals from caller
186 if ((local_ns is None or module is None or compile_flags is None)
192 if ((local_ns is None or module is None or compile_flags is None)
187 and self.default_user_namespaces):
193 and self.default_user_namespaces):
@@ -226,7 +232,7 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
226 self.set_completer_frame()
232 self.set_completer_frame()
227
233
228 with self.builtin_trap, self.display_trap:
234 with self.builtin_trap, self.display_trap:
229 self.interact(display_banner=display_banner)
235 self.interact()
230
236
231 # now, purge out the local namespace of IPython's hidden variables.
237 # now, purge out the local namespace of IPython's hidden variables.
232 if local_ns is not None:
238 if local_ns is not None:
General Comments 0
You need to be logged in to leave comments. Login now