##// END OF EJS Templates
sys.displayhook is now managed dynamically by display_trap.
sys.displayhook is now managed dynamically by display_trap.

File last commit:

r2226:7053ea2c
r2231:732f3d1a
Show More
ipapi.py
58 lines | 1.7 KiB | text/x-python | PythonLexer
Brian Granger
Continuing a massive refactor of everything.
r2205 #!/usr/bin/env python
# encoding: utf-8
"""
Oh my @#*%, where did ipapi go?
ville
initialization (no svn history)
r988
Brian Granger
Continuing a massive refactor of everything.
r2205 Originally, this module was designed to be a public api for IPython. It is
now deprecated and replaced by :class:`IPython.core.Interactive` shell.
Almost all of the methods that were here are now there, but possibly renamed.
ville
initialization (no svn history)
r988
Brian Granger
Continuing a massive refactor of everything.
r2205 During our transition, we will keep this simple module with its :func:`get`
function. It too will eventually go away when the new component querying
interface is fully used.
ville
initialization (no svn history)
r988
Brian Granger
Continuing a massive refactor of everything.
r2205 Authors:
ville
initialization (no svn history)
r988
Brian Granger
Continuing a massive refactor of everything.
r2205 * Brian Granger
Fernando Perez
Remove 2.3 compatibility, minor cleanups.
r1414 """
#-----------------------------------------------------------------------------
Brian Granger
Continuing a massive refactor of everything.
r2205 # Copyright (C) 2008-2009 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
Fernando Perez
Remove 2.3 compatibility, minor cleanups.
r1414 #-----------------------------------------------------------------------------
ville
initialization (no svn history)
r988
Brian Granger
Continuing a massive refactor of everything.
r2205 #-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
Robert Kern
ENH: Allow non-dict namespaces. This involves a change in the ipapi for setting user namespaces.
r1419
Brian Granger
Continuing a massive refactor of everything.
r2205 from IPython.core.error import TryNext, UsageError
Robert Kern
ENH: Allow non-dict namespaces. This involves a change in the ipapi for setting user namespaces.
r1419
Brian Granger
Continuing a massive refactor of everything.
r2205 #-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------
Robert Kern
ENH: Allow non-dict namespaces. This involves a change in the ipapi for setting user namespaces.
r1419
Brian Granger
Continuing a massive refactor of everything.
r2205 def get():
"""Get the most recently created InteractiveShell instance."""
Brian Granger
Cleaned up embedded shell and added cleanup method to InteractiveShell....
r2226 from IPython.core.iplib import InteractiveShell
Brian Granger
Merging upstream changes from inputhook and config-refactor....
r2224 insts = InteractiveShell.get_instances()
Brian Granger
Continuing a massive refactor of everything.
r2205 most_recent = insts[0]
for inst in insts[1:]:
if inst.created > most_recent.created:
most_recent = inst
Brian Granger
Removed shell.py entirely and made the embedded shell a proper subclass....
r2206 return most_recent
def launch_new_instance():
"""Create a run a full blown IPython instance"""
from IPython.core.ipapp import IPythonApp
app = IPythonApp()
app.start()
Robert Kern
ENH: Allow non-dict namespaces. This involves a change in the ipapi for setting user namespaces.
r1419
ville
initialization (no svn history)
r988