##// END OF EJS Templates
Manage and propagate argv correctly....
Manage and propagate argv correctly. All Application objects should take argv in their constructor, akin to how the standard signature of C programs is "main(int argc, char *argv)". This makes it possible to initialize them from code with different command-line options (otherwise, they end up directly accessing sys.argv[1:] via argparse).

File last commit:

r2292:146be237
r2391:1d7c11a4
Show More
ipapi.py
38 lines | 1.4 KiB | text/x-python | PythonLexer
Brian Granger
Continuing a massive refactor of everything.
r2205 #!/usr/bin/env python
# encoding: utf-8
"""
Brian Granger
Removed ipapi compatability layer and updated top-level functions....
r2269 This module is *completely* deprecated and should no longer be used for
any purpose. Currently, we have a few parts of the core that have
not been componentized and thus, still rely on this module. When everything
has been made into a component, this module will be sent to deathrow.
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
ipapi.get now returns None if there are no InteractiveShells running....
r2292 from IPython.core.error import TryNext, UsageError, IPythonCoreError
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
ipapi.get now returns None if there are no InteractiveShells running....
r2292
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
ipapi.get now returns None if there are no InteractiveShells running....
r2292 if len(insts)==0:
return None
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