diff --git a/IPython/__init__.py b/IPython/__init__.py index aea962b..c8f33cf 100755 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -40,10 +40,9 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "extensions")) from .config.loader import Config from .core import release from .core.application import Application -from .core.ipapp import IPythonApp -from .core.embed import embed +from .frontend.terminal.embed import embed from .core.error import TryNext -from .core.iplib import InteractiveShell +from .core.interactiveshell import InteractiveShell from .testing import test from .lib import ( diff --git a/IPython/core/alias.py b/IPython/core/alias.py index 506097a..59c936d 100644 --- a/IPython/core/alias.py +++ b/IPython/core/alias.py @@ -104,7 +104,7 @@ class AliasManager(Configurable): default_aliases = List(default_aliases(), config=True) user_aliases = List(default_value=[], config=True) - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') def __init__(self, shell=None, config=None): super(AliasManager, self).__init__(shell=shell, config=config) diff --git a/IPython/core/builtin_trap.py b/IPython/core/builtin_trap.py index 758d514..029b2ff 100755 --- a/IPython/core/builtin_trap.py +++ b/IPython/core/builtin_trap.py @@ -37,7 +37,7 @@ BuiltinUndefined = __BuiltinUndefined() class BuiltinTrap(Configurable): - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') def __init__(self, shell=None): super(BuiltinTrap, self).__init__(shell=shell, config=None) diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 151a4b1..6c422ec 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -184,7 +184,7 @@ class Pdb(OldPdb): if self.is_pydb: - # iplib.py's ipalias seems to want pdb's checkline + # interactiveshell.py's ipalias seems to want pdb's checkline # which located in pydb.fn import pydb.fns self.checkline = lambda filename, lineno: \ diff --git a/IPython/core/extensions.py b/IPython/core/extensions.py index bf1757e..a087b93 100644 --- a/IPython/core/extensions.py +++ b/IPython/core/extensions.py @@ -53,7 +53,7 @@ class ExtensionManager(Configurable): is added to ``sys.path`` automatically. """ - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') def __init__(self, shell=None, config=None): super(ExtensionManager, self).__init__(shell=shell, config=config) diff --git a/IPython/core/iplib.py b/IPython/core/interactiveshell.py similarity index 100% rename from IPython/core/iplib.py rename to IPython/core/interactiveshell.py diff --git a/IPython/core/ipapi.py b/IPython/core/ipapi.py index 24fe36d..0d79aa0 100644 --- a/IPython/core/ipapi.py +++ b/IPython/core/ipapi.py @@ -25,6 +25,6 @@ has been made into a component, this module will be sent to deathrow. def get(): """Get the global InteractiveShell instance.""" - from IPython.core.iplib import InteractiveShell + from IPython.core.interactiveshell import InteractiveShell return InteractiveShell.instance() diff --git a/IPython/core/magic.py b/IPython/core/magic.py index b44a41a..7e1c0be 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -1699,7 +1699,7 @@ Currently the magic system has the following functions:\n""" # set the __file__ global in the script's namespace prog_ns['__file__'] = filename - # pickle fix. See iplib for an explanation. But we need to make sure + # pickle fix. See interactiveshell for an explanation. But we need to make sure # that, if we overwrite __main__, we replace it at the end main_mod_name = prog_ns['__name__'] @@ -3327,10 +3327,10 @@ Defaulting color scheme to 'NoColor'""" def _get_pasted_lines(self, sentinel): """ Yield pasted lines until the user enters the given sentinel value. """ - from IPython.core import iplib + from IPython.core import interactiveshell print "Pasting code; enter '%s' alone on the line to stop." % sentinel while True: - l = iplib.raw_input_original(':') + l = interactiveshell.raw_input_original(':') if l == sentinel: return else: diff --git a/IPython/core/prefilter.py b/IPython/core/prefilter.py index 50a8b67..ca9c295 100755 --- a/IPython/core/prefilter.py +++ b/IPython/core/prefilter.py @@ -210,7 +210,7 @@ class PrefilterManager(Configurable): """ multi_line_specials = CBool(True, config=True) - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') def __init__(self, shell=None, config=None): super(PrefilterManager, self).__init__(shell=shell, config=config) @@ -453,7 +453,7 @@ class PrefilterTransformer(Configurable): priority = Int(100, config=True) # Transformers don't currently use shell or prefilter_manager, but as we # move away from checkers and handlers, they will need them. - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager') enabled = Bool(True, config=True) @@ -561,7 +561,7 @@ class PrefilterChecker(Configurable): """Inspect an input line and return a handler for that line.""" priority = Int(100, config=True) - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager') enabled = Bool(True, config=True) @@ -754,7 +754,7 @@ class PrefilterHandler(Configurable): handler_name = Str('normal') esc_strings = List([]) - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager') def __init__(self, shell=None, prefilter_manager=None, config=None): diff --git a/IPython/core/splitinput.py b/IPython/core/splitinput.py index ebf323f..99dc0b5 100644 --- a/IPython/core/splitinput.py +++ b/IPython/core/splitinput.py @@ -30,7 +30,7 @@ import re # RegExp for splitting line contents into pre-char//first word-method//rest. # For clarity, each group in on one line. -# WARNING: update the regexp if the escapes in iplib are changed, as they +# WARNING: update the regexp if the escapes in interactiveshell are changed, as they # are hardwired in. # Although it's not solely driven by the regex, note that: diff --git a/IPython/core/tests/test_imports.py b/IPython/core/tests/test_imports.py index 6257539..a5e47cc 100644 --- a/IPython/core/tests/test_imports.py +++ b/IPython/core/tests/test_imports.py @@ -25,8 +25,8 @@ def test_import_hooks(): def test_import_ipapi(): from IPython.core import ipapi -def test_import_iplib(): - from IPython.core import iplib +def test_import_interactiveshell(): + from IPython.core import interactiveshell def test_import_logger(): from IPython.core import logger diff --git a/IPython/core/tests/test_iplib.py b/IPython/core/tests/test_iplib.py index 8b4276c..d229ae7 100644 --- a/IPython/core/tests/test_iplib.py +++ b/IPython/core/tests/test_iplib.py @@ -1,4 +1,4 @@ -"""Tests for the key iplib module, where the main ipython class is defined. +"""Tests for the key interactiveshell module, where the main ipython class is defined. """ #----------------------------------------------------------------------------- # Module imports @@ -60,7 +60,7 @@ def test_reset(): # Tests for reporting of exceptions in various modes, handling of SystemExit, -# and %tb functionality. This is really a mix of testing ultraTB and iplib. +# and %tb functionality. This is really a mix of testing ultraTB and interactiveshell. def doctest_tb_plain(): """ diff --git a/IPython/Shell.py b/IPython/deathrow/Shell.py similarity index 100% rename from IPython/Shell.py rename to IPython/deathrow/Shell.py diff --git a/IPython/iplib.py b/IPython/deathrow/iplib.py similarity index 100% rename from IPython/iplib.py rename to IPython/deathrow/iplib.py diff --git a/IPython/scripts/ipython-wx b/IPython/deathrow/ipython-wx similarity index 100% rename from IPython/scripts/ipython-wx rename to IPython/deathrow/ipython-wx diff --git a/IPython/scripts/ipythonx b/IPython/deathrow/ipythonx similarity index 100% rename from IPython/scripts/ipythonx rename to IPython/deathrow/ipythonx diff --git a/IPython/extensions/parallelmagic.py b/IPython/extensions/parallelmagic.py index 3f53468..1e2f482 100755 --- a/IPython/extensions/parallelmagic.py +++ b/IPython/extensions/parallelmagic.py @@ -36,7 +36,7 @@ class ParalleMagic(Plugin): active_multiengine_client = Any() verbose = Bool(False, config=True) - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') def __init__(self, shell=None, config=None): super(ParalleMagic, self).__init__(shell=shell, config=config) diff --git a/IPython/extensions/pretty.py b/IPython/extensions/pretty.py index 8f05b23..3adf476 100644 --- a/IPython/extensions/pretty.py +++ b/IPython/extensions/pretty.py @@ -55,7 +55,7 @@ class PrettyResultDisplay(Plugin): """A component for pretty printing on steroids.""" verbose = Bool(False, config=True) - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') # A list of (type, func_name), like # [(dict, 'my_dict_printer')] diff --git a/IPython/extensions/tests/test_pretty.py b/IPython/extensions/tests/test_pretty.py index c7da78a..54dc9ba 100644 --- a/IPython/extensions/tests/test_pretty.py +++ b/IPython/extensions/tests/test_pretty.py @@ -18,7 +18,7 @@ Simple tests for :mod:`IPython.extensions.pretty`. from unittest import TestCase from IPython.config.configurable import Configurable -from IPython.core.iplib import InteractiveShellABC +from IPython.core.interactiveshell import InteractiveShellABC from IPython.extensions import pretty as pretty_ext from IPython.external import pretty from IPython.testing import decorators as dec diff --git a/IPython/frontend/terminal/__init__.py b/IPython/frontend/terminal/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/IPython/frontend/terminal/__init__.py diff --git a/IPython/core/embed.py b/IPython/frontend/terminal/embed.py similarity index 98% rename from IPython/core/embed.py rename to IPython/frontend/terminal/embed.py index fc68ec1..eaf8c87 100755 --- a/IPython/core/embed.py +++ b/IPython/frontend/terminal/embed.py @@ -30,8 +30,8 @@ import sys from contextlib import nested from IPython.core import ultratb -from IPython.core.iplib import InteractiveShell -from IPython.core.ipapp import load_default_config +from IPython.core.interactiveshell import InteractiveShell +from IPython.frontend.terminal.ipapp import load_default_config from IPython.utils.traitlets import Bool, Str, CBool from IPython.utils.io import ask_yes_no diff --git a/IPython/core/ipapp.py b/IPython/frontend/terminal/ipapp.py similarity index 98% rename from IPython/core/ipapp.py rename to IPython/frontend/terminal/ipapp.py index 6733afe..0062332 100755 --- a/IPython/core/ipapp.py +++ b/IPython/frontend/terminal/ipapp.py @@ -31,14 +31,14 @@ import sys from IPython.core import release from IPython.core.crashhandler import CrashHandler from IPython.core.application import Application, BaseAppConfigLoader -from IPython.core.iplib import InteractiveShell +from IPython.core.interactiveshell import InteractiveShell from IPython.config.loader import ( Config, PyFileConfigLoader ) from IPython.lib import inputhook from IPython.utils.path import filefind, get_ipython_dir -from . import usage +from IPython.core import usage #----------------------------------------------------------------------------- # Globals, utilities and helpers diff --git a/IPython/frontend/terminal/scripts/__init__.py b/IPython/frontend/terminal/scripts/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/IPython/frontend/terminal/scripts/__init__.py diff --git a/IPython/scripts/ipython b/IPython/frontend/terminal/scripts/ipython similarity index 75% rename from IPython/scripts/ipython rename to IPython/frontend/terminal/scripts/ipython index 65fec55..5a3546b 100755 --- a/IPython/scripts/ipython +++ b/IPython/frontend/terminal/scripts/ipython @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from IPython.core.ipapp import launch_new_instance +from IPython.frontend.terminal.ipapp import launch_new_instance launch_new_instance() diff --git a/IPython/frontend/terminal/tests/__init__.py b/IPython/frontend/terminal/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/IPython/frontend/terminal/tests/__init__.py diff --git a/IPython/testing/globalipapp.py b/IPython/testing/globalipapp.py index efae6e7..f41cf6a 100644 --- a/IPython/testing/globalipapp.py +++ b/IPython/testing/globalipapp.py @@ -115,7 +115,7 @@ def start_ipython(): start_ipython.already_called = True # Ok, first time we're called, go ahead - from IPython.core import iplib + from IPython.core import interactiveshell def xsys(cmd): """Execute a command and print its output. @@ -136,7 +136,7 @@ def start_ipython(): config = tools.default_config() # Create and initialize our test-friendly IPython instance. - shell = iplib.InteractiveShell.instance( + shell = interactiveshell.InteractiveShell.instance( config=config, user_ns=ipnsdict(), user_global_ns={} ) diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index 76ac761..a39e53b 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -153,10 +153,6 @@ def make_exclude(): ipjoin = lambda *paths: pjoin('IPython', *paths) exclusions = [ipjoin('external'), - # Deprecated old Shell and iplib modules, skip to avoid - # warnings - ipjoin('Shell'), - ipjoin('iplib'), pjoin('IPython_doctest_plugin'), ipjoin('quarantine'), ipjoin('deathrow'), diff --git a/IPython/testing/plugin/Makefile b/IPython/testing/plugin/Makefile index db82075..6f999a3 100644 --- a/IPython/testing/plugin/Makefile +++ b/IPython/testing/plugin/Makefile @@ -8,7 +8,7 @@ NOSE=nosetests -vvs --with-ipdoctest --doctest-tests --doctest-extension=txt \ SRC=ipdoctest.py setup.py ../decorators.py # Default target for clean 'make' -default: iplib +default: interactiveshell # The actual plugin installation plugin: IPython_doctest_plugin.egg-info @@ -39,8 +39,8 @@ magic: plugin excolors: plugin $(NOSE) IPython.core.excolors -iplib: plugin - $(NOSE) IPython.core.iplib +interactiveshell: plugin + $(NOSE) IPython.core.interactiveshell strd: plugin $(NOSE) IPython.core.strdispatch @@ -61,7 +61,7 @@ sr: rtest strd base: dtest rtest test strd deco -quick: base iplib ipipe +quick: base interactiveshell ipipe all: base ipython diff --git a/IPython/utils/process.py b/IPython/utils/process.py index 2d8919c..3a2ac78 100644 --- a/IPython/utils/process.py +++ b/IPython/utils/process.py @@ -77,7 +77,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.core.ipapp')) + argv = pycmd2argv(get_ipython_module_path('IPython.frontend.terminal.ipapp')) Parameters ---------- diff --git a/IPython/utils/tests/test_path.py b/IPython/utils/tests/test_path.py index 1715960..db9a8a8 100644 --- a/IPython/utils/tests/test_path.py +++ b/IPython/utils/tests/test_path.py @@ -255,7 +255,7 @@ def test_get_ipython_package_dir(): def test_get_ipython_module_path(): - ipapp_path = path.get_ipython_module_path('IPython.core.ipapp') + ipapp_path = path.get_ipython_module_path('IPython.frontend.terminal.ipapp') nt.assert_true(os.path.isfile(ipapp_path)) diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index 601fce5..e206923 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -27,7 +27,7 @@ import zmq # Local imports. from IPython.config.configurable import Configurable -from IPython.core.iplib import InteractiveShell, InteractiveShellABC +from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC from IPython.external.argparse import ArgumentParser from IPython.utils.traitlets import Instance from IPython.zmq.session import Session, Message @@ -42,7 +42,7 @@ from exitpoller import ExitPollerUnix, ExitPollerWindows class Kernel(Configurable): - shell = Instance('IPython.core.iplib.InteractiveShellABC') + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC') session = Instance('IPython.zmq.session.Session') reply_socket = Instance('zmq.Socket') pub_socket = Instance('zmq.Socket') diff --git a/ipython.py b/ipython.py index ae5c5ea..29db095 100755 --- a/ipython.py +++ b/ipython.py @@ -13,4 +13,6 @@ this_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, this_dir) # Now proceed with execution -execfile(os.path.join(this_dir, 'IPython', 'scripts', 'ipython')) +execfile(os.path.join( + this_dir, 'IPython', 'frontend', 'terminal', 'scripts', 'ipython' +)) diff --git a/scripts/ipython_win_post_install.py b/scripts/ipython_win_post_install.py index a965ee8..606fd7f 100755 --- a/scripts/ipython_win_post_install.py +++ b/scripts/ipython_win_post_install.py @@ -35,8 +35,6 @@ def install(): 'ipcontroller', 'ipengine', 'ipcluster', - 'ipythonx', - 'ipython-wx', 'irunner' ] scripts = pjoin(prefix,'scripts') diff --git a/setup.py b/setup.py index 2798796..01174e1 100755 --- a/setup.py +++ b/setup.py @@ -207,12 +207,11 @@ if 'setuptools' in sys.modules: setuptools_extra_args['zip_safe'] = False setuptools_extra_args['entry_points'] = { 'console_scripts': [ - 'ipython = IPython.core.ipapp:launch_new_instance', + 'ipython = IPython.frontend.terminal.ipapp:launch_new_instance', 'pycolor = IPython.utils.PyColorize:main', 'ipcontroller = IPython.kernel.ipcontrollerapp:launch_new_instance', 'ipengine = IPython.kernel.ipengineapp:launch_new_instance', 'ipcluster = IPython.kernel.ipclusterapp:launch_new_instance', - 'ipythonx = IPython.frontend.wx.ipythonx:main', 'iptest = IPython.testing.iptest:main', 'irunner = IPython.lib.irunner:main' ] diff --git a/setupbase.py b/setupbase.py index 9542911..a4afdae 100644 --- a/setupbase.py +++ b/setupbase.py @@ -111,6 +111,7 @@ def find_packages(): add_package(packages, 'frontend') add_package(packages, 'frontend.qt') add_package(packages, 'frontend.qt.console') + add_package(packages, 'frontend.terminal', config=False, tests=True, scripts=True) add_package(packages, 'kernel', config=False, tests=True, scripts=True) add_package(packages, 'kernel.core', config=False, tests=True) add_package(packages, 'lib', tests=True) @@ -254,12 +255,11 @@ def find_scripts(): """ kernel_scripts = pjoin('IPython','kernel','scripts') main_scripts = pjoin('IPython','scripts') + frontend_terminal_scripts = pjoin('IPython','frontend','terminal','scripts') scripts = [pjoin(kernel_scripts, 'ipengine'), pjoin(kernel_scripts, 'ipcontroller'), pjoin(kernel_scripts, 'ipcluster'), - pjoin(main_scripts, 'ipython'), - pjoin(main_scripts, 'ipythonx'), - pjoin(main_scripts, 'ipython-wx'), + pjoin(frontend_terminal_scripts, 'ipython'), pjoin(main_scripts, 'pycolor'), pjoin(main_scripts, 'irunner'), pjoin(main_scripts, 'iptest')