From 4571a5fb53ac69cf22d25a9432c4b53b87347b57 2013-06-27 18:14:07 From: Fernando Perez Date: 2013-06-27 18:14:07 Subject: [PATCH] Fix all remaining imports that used `IPython.frontend`. --- diff --git a/IPython/__main__.py b/IPython/__main__.py index 66af32a..1e2ee07 100644 --- a/IPython/__main__.py +++ b/IPython/__main__.py @@ -9,6 +9,6 @@ # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- -from IPython.frontend.terminal.ipapp import launch_new_instance +from IPython.terminal.ipapp import launch_new_instance launch_new_instance() diff --git a/IPython/consoleapp.py b/IPython/consoleapp.py index 67148f7..8813d83 100644 --- a/IPython/consoleapp.py +++ b/IPython/consoleapp.py @@ -2,7 +2,7 @@ This is not a complete console app, as subprocess will not be able to receive input, there is no real readline support, among other limitations. This is a -refactoring of what used to be the IPython/frontend/qt/console/qtconsoleapp.py +refactoring of what used to be the IPython/qt/console/qtconsoleapp.py Authors: diff --git a/IPython/core/profileapp.py b/IPython/core/profileapp.py index 39479cd..1fe29cf 100644 --- a/IPython/core/profileapp.py +++ b/IPython/core/profileapp.py @@ -238,10 +238,10 @@ class ProfileCreate(BaseIPythonApplication): def init_config_files(self): super(ProfileCreate, self).init_config_files() # use local imports, since these classes may import from here - from IPython.frontend.terminal.ipapp import TerminalIPythonApp + from IPython.terminal.ipapp import TerminalIPythonApp apps = [TerminalIPythonApp] try: - from IPython.frontend.qt.console.qtconsoleapp import IPythonQtConsoleApp + from IPython.qt.console.qtconsoleapp import IPythonQtConsoleApp except Exception: # this should be ImportError, but under weird circumstances # this might be an AttributeError, or possibly others @@ -250,7 +250,7 @@ class ProfileCreate(BaseIPythonApplication): else: apps.append(IPythonQtConsoleApp) try: - from IPython.frontend.html.notebook.notebookapp import NotebookApp + from IPython.html.notebook.notebookapp import NotebookApp except ImportError: pass except Exception: diff --git a/IPython/frontend.py b/IPython/frontend.py index 6de00ec..c5055f3 100644 --- a/IPython/frontend.py +++ b/IPython/frontend.py @@ -2,9 +2,10 @@ Shim to maintain backwards compatibility with old frontend imports. We have moved all contents of the old `frontend` subpackage into top-level -subpackages (`html`, `qt` and `terminal`). This will let code that was making -`from IPython.frontend...` calls continue working, though a warning will be -printed. +subpackages (`html`, `qt` and `terminal`). + +This will let code that was making `from IPython.frontend...` calls continue +working, though a warning will be printed. """ #----------------------------------------------------------------------------- @@ -28,7 +29,6 @@ from warnings import warn warn("The top-level `frontend` package has been deprecated. " "All its subpackages have been moved to the top `IPython` level.") -1/0 #----------------------------------------------------------------------------- # Class declarations #----------------------------------------------------------------------------- diff --git a/IPython/html/notebook/README.md b/IPython/html/notebook/README.md index e528167..13b60f9 100644 --- a/IPython/html/notebook/README.md +++ b/IPython/html/notebook/README.md @@ -54,7 +54,7 @@ wide install. First, cd into js directory : ```bash -cd IPython/frontend/html/notebook/static/js/ +cd IPython/html/notebook/static/js/ # install yuidoc npm install yuidocjs ``` @@ -62,7 +62,7 @@ npm install yuidocjs ### Run YUIdoc server -From IPython/frontend/html/notebook/static/js/ +From IPython/html/notebook/static/js/ ```bash # run yuidoc for install dir ./node_modules/yuidocjs/lib/cli.js --server . @@ -70,4 +70,4 @@ From IPython/frontend/html/notebook/static/js/ Follow the instruction and the documentation should be available on localhost:3000 -Omitting `--server` will build a static version in the `out` folder by default. \ No newline at end of file +Omitting `--server` will build a static version in the `out` folder by default. diff --git a/IPython/kernel/connect.py b/IPython/kernel/connect.py index 0a431df..ae8e406 100644 --- a/IPython/kernel/connect.py +++ b/IPython/kernel/connect.py @@ -300,7 +300,7 @@ def connect_qtconsole(connection_file=None, argv=None, profile=None): cf = find_connection_file(connection_file, profile=profile) cmd = ';'.join([ - "from IPython.frontend.qt.console import qtconsoleapp", + "from IPython.qt.console import qtconsoleapp", "qtconsoleapp.main()" ]) diff --git a/IPython/qt/console/tests/test_ansi_code_processor.py b/IPython/qt/console/tests/test_ansi_code_processor.py index 0e8de98..06752fb 100644 --- a/IPython/qt/console/tests/test_ansi_code_processor.py +++ b/IPython/qt/console/tests/test_ansi_code_processor.py @@ -2,7 +2,7 @@ import unittest # Local imports -from IPython.frontend.qt.console.ansi_code_processor import AnsiCodeProcessor +from IPython.qt.console.ansi_code_processor import AnsiCodeProcessor class TestAnsiCodeProcessor(unittest.TestCase): diff --git a/IPython/qt/console/tests/test_completion_lexer.py b/IPython/qt/console/tests/test_completion_lexer.py index 6c948c6..70c9174 100644 --- a/IPython/qt/console/tests/test_completion_lexer.py +++ b/IPython/qt/console/tests/test_completion_lexer.py @@ -5,7 +5,7 @@ import unittest from pygments.lexers import CLexer, CppLexer, PythonLexer # Local imports -from IPython.frontend.qt.console.completion_lexer import CompletionLexer +from IPython.qt.console.completion_lexer import CompletionLexer class TestCompletionLexer(unittest.TestCase): diff --git a/IPython/qt/console/tests/test_console_widget.py b/IPython/qt/console/tests/test_console_widget.py index 9f24820..cd86c2a 100644 --- a/IPython/qt/console/tests/test_console_widget.py +++ b/IPython/qt/console/tests/test_console_widget.py @@ -5,7 +5,7 @@ import unittest from IPython.external.qt import QtCore, QtGui # Local imports -from IPython.frontend.qt.console.console_widget import ConsoleWidget +from IPython.qt.console.console_widget import ConsoleWidget class TestConsoleWidget(unittest.TestCase): diff --git a/IPython/qt/console/tests/test_kill_ring.py b/IPython/qt/console/tests/test_kill_ring.py index 32c41c6..d32d045 100644 --- a/IPython/qt/console/tests/test_kill_ring.py +++ b/IPython/qt/console/tests/test_kill_ring.py @@ -5,7 +5,7 @@ import unittest from IPython.external.qt import QtCore, QtGui # Local imports -from IPython.frontend.qt.console.kill_ring import KillRing, QtKillRing +from IPython.qt.console.kill_ring import KillRing, QtKillRing class TestKillRing(unittest.TestCase): diff --git a/IPython/terminal/console/tests/test_image_handler.py b/IPython/terminal/console/tests/test_image_handler.py index 21f615a..11e3852 100644 --- a/IPython/terminal/console/tests/test_image_handler.py +++ b/IPython/terminal/console/tests/test_image_handler.py @@ -11,8 +11,7 @@ import unittest import base64 from IPython.kernel import KernelClient -from IPython.frontend.terminal.console.interactiveshell \ - import ZMQTerminalInteractiveShell +from IPython.terminal.console.interactiveshell import ZMQTerminalInteractiveShell from IPython.utils.tempdir import TemporaryDirectory from IPython.testing.tools import monkeypatch from IPython.testing.decorators import skip_without diff --git a/IPython/testing/globalipapp.py b/IPython/testing/globalipapp.py index b647801..861f575 100644 --- a/IPython/testing/globalipapp.py +++ b/IPython/testing/globalipapp.py @@ -30,7 +30,7 @@ from . import tools from IPython.core import page from IPython.utils import io from IPython.utils import py3compat -from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell +from IPython.terminal.interactiveshell import TerminalInteractiveShell #----------------------------------------------------------------------------- # Functions diff --git a/IPython/utils/process.py b/IPython/utils/process.py index d9aab85..42c6bf5 100644 --- a/IPython/utils/process.py +++ b/IPython/utils/process.py @@ -51,7 +51,7 @@ def find_cmd(cmd): from IPython.utils.path import get_ipython_module_path from IPython.utils.process import pycmd2argv - argv = pycmd2argv(get_ipython_module_path('IPython.frontend.terminal.ipapp')) + argv = pycmd2argv(get_ipython_module_path('IPython.terminal.ipapp')) Parameters ---------- diff --git a/IPython/utils/tests/test_path.py b/IPython/utils/tests/test_path.py index cf0f228..c5b0376 100644 --- a/IPython/utils/tests/test_path.py +++ b/IPython/utils/tests/test_path.py @@ -404,7 +404,7 @@ def test_get_ipython_package_dir(): def test_get_ipython_module_path(): - ipapp_path = path.get_ipython_module_path('IPython.frontend.terminal.ipapp') + ipapp_path = path.get_ipython_module_path('IPython.terminal.ipapp') nt.assert_true(os.path.isfile(ipapp_path))