From 3bf3158c9aae58ea7b5a4e9694d735eb3050e0bb 2013-06-27 18:14:06 From: Fernando Perez Date: 2013-06-27 18:14:06 Subject: [PATCH] Fix imports for plain terminal ipython and use a proper warn() call. --- diff --git a/IPython/__init__.py b/IPython/__init__.py index d553587..c804cd4 100644 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -44,7 +44,7 @@ from .config.loader import Config from .core.getipython import get_ipython from .core import release from .core.application import Application -from .frontend.terminal.embed import embed +from .terminal.embed import embed from .core.error import TryNext from .core.interactiveshell import InteractiveShell diff --git a/IPython/frontend.py b/IPython/frontend.py index edce202..a8c29a5 100644 --- a/IPython/frontend.py +++ b/IPython/frontend.py @@ -23,15 +23,10 @@ from __future__ import print_function # Stdlib import sys import types +from warnings import warn -m = """\ -*** WARNING*** : The top-level `frontend` package has been deprecated. -All its subpackages have been moved to the top `IPython` level.""" - -print(m, file=sys.stderr) - -# FIXME: turn this into a Warning once we've fixed all our own imports. -#raise DeprecationWarning(m) +warn("The top-level `frontend` package has been deprecated. " + "All its subpackages have been moved to the top `IPython` level.") #----------------------------------------------------------------------------- # Class declarations diff --git a/IPython/scripts/ipython b/IPython/scripts/ipython index b435148..2aed24c 100755 --- a/IPython/scripts/ipython +++ b/IPython/scripts/ipython @@ -2,6 +2,6 @@ """Terminal-based IPython entry point. """ -from IPython.frontend.terminal.ipapp import launch_new_instance +from IPython.terminal.ipapp import launch_new_instance launch_new_instance() diff --git a/IPython/terminal/embed.py b/IPython/terminal/embed.py index a831575..3b06bfc 100644 --- a/IPython/terminal/embed.py +++ b/IPython/terminal/embed.py @@ -36,8 +36,8 @@ except: from IPython.core import ultratb, compilerop from IPython.core.magic import Magics, magics_class, line_magic -from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell -from IPython.frontend.terminal.ipapp import load_default_config +from IPython.terminal.interactiveshell import TerminalInteractiveShell +from IPython.terminal.ipapp import load_default_config from IPython.utils.traitlets import Bool, CBool, Unicode from IPython.utils.io import ask_yes_no diff --git a/IPython/terminal/ipapp.py b/IPython/terminal/ipapp.py index 4b91670..29e7447 100755 --- a/IPython/terminal/ipapp.py +++ b/IPython/terminal/ipapp.py @@ -47,7 +47,7 @@ from IPython.core.magics import ScriptMagics from IPython.core.shellapp import ( InteractiveShellApp, shell_flags, shell_aliases ) -from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell +from IPython.terminal.interactiveshell import TerminalInteractiveShell from IPython.utils import warn from IPython.utils.path import get_ipython_dir, check_for_old_config from IPython.utils.traitlets import ( @@ -223,10 +223,10 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): ] subcommands = Dict(dict( - qtconsole=('IPython.frontend.qt.console.qtconsoleapp.IPythonQtConsoleApp', + qtconsole=('IPython.qt.console.qtconsoleapp.IPythonQtConsoleApp', """Launch the IPython Qt Console.""" ), - notebook=('IPython.frontend.html.notebook.notebookapp.NotebookApp', + notebook=('IPython.html.notebook.notebookapp.NotebookApp', """Launch the IPython HTML Notebook Server.""" ), profile = ("IPython.core.profileapp.ProfileApp", @@ -235,10 +235,10 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): kernel = ("IPython.kernel.zmq.kernelapp.IPKernelApp", "Start a kernel without an attached frontend." ), - console=('IPython.frontend.terminal.console.app.ZMQTerminalIPythonApp', + console=('IPython.terminal.console.app.ZMQTerminalIPythonApp', """Launch the IPython terminal-based Console.""" ), - locate=('IPython.frontend.terminal.ipapp.LocateIPythonApp', + locate=('IPython.terminal.ipapp.LocateIPythonApp', LocateIPythonApp.description ), history=('IPython.core.historyapp.HistoryApp',