##// END OF EJS Templates
Moving and renaming in preparation of subclassing InteractiveShell....
Brian Granger -
Show More
1 NO CONTENT: new file 100644
1 NO CONTENT: new file 100644
1 NO CONTENT: new file 100644
@@ -40,10 +40,9 b' sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))'
40 40 from .config.loader import Config
41 41 from .core import release
42 42 from .core.application import Application
43 from .core.ipapp import IPythonApp
44 from .core.embed import embed
43 from .frontend.terminal.embed import embed
45 44 from .core.error import TryNext
46 from .core.iplib import InteractiveShell
45 from .core.interactiveshell import InteractiveShell
47 46 from .testing import test
48 47
49 48 from .lib import (
@@ -104,7 +104,7 b' class AliasManager(Configurable):'
104 104
105 105 default_aliases = List(default_aliases(), config=True)
106 106 user_aliases = List(default_value=[], config=True)
107 shell = Instance('IPython.core.iplib.InteractiveShellABC')
107 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
108 108
109 109 def __init__(self, shell=None, config=None):
110 110 super(AliasManager, self).__init__(shell=shell, config=config)
@@ -37,7 +37,7 b' BuiltinUndefined = __BuiltinUndefined()'
37 37
38 38 class BuiltinTrap(Configurable):
39 39
40 shell = Instance('IPython.core.iplib.InteractiveShellABC')
40 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
41 41
42 42 def __init__(self, shell=None):
43 43 super(BuiltinTrap, self).__init__(shell=shell, config=None)
@@ -184,7 +184,7 b' class Pdb(OldPdb):'
184 184
185 185 if self.is_pydb:
186 186
187 # iplib.py's ipalias seems to want pdb's checkline
187 # interactiveshell.py's ipalias seems to want pdb's checkline
188 188 # which located in pydb.fn
189 189 import pydb.fns
190 190 self.checkline = lambda filename, lineno: \
@@ -53,7 +53,7 b' class ExtensionManager(Configurable):'
53 53 is added to ``sys.path`` automatically.
54 54 """
55 55
56 shell = Instance('IPython.core.iplib.InteractiveShellABC')
56 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
57 57
58 58 def __init__(self, shell=None, config=None):
59 59 super(ExtensionManager, self).__init__(shell=shell, config=config)
1 NO CONTENT: file renamed from IPython/core/iplib.py to IPython/core/interactiveshell.py
@@ -25,6 +25,6 b' has been made into a component, this module will be sent to deathrow.'
25 25
26 26 def get():
27 27 """Get the global InteractiveShell instance."""
28 from IPython.core.iplib import InteractiveShell
28 from IPython.core.interactiveshell import InteractiveShell
29 29 return InteractiveShell.instance()
30 30
@@ -1699,7 +1699,7 b' Currently the magic system has the following functions:\\n"""'
1699 1699 # set the __file__ global in the script's namespace
1700 1700 prog_ns['__file__'] = filename
1701 1701
1702 # pickle fix. See iplib for an explanation. But we need to make sure
1702 # pickle fix. See interactiveshell for an explanation. But we need to make sure
1703 1703 # that, if we overwrite __main__, we replace it at the end
1704 1704 main_mod_name = prog_ns['__name__']
1705 1705
@@ -3327,10 +3327,10 b' Defaulting color scheme to \'NoColor\'"""'
3327 3327 def _get_pasted_lines(self, sentinel):
3328 3328 """ Yield pasted lines until the user enters the given sentinel value.
3329 3329 """
3330 from IPython.core import iplib
3330 from IPython.core import interactiveshell
3331 3331 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3332 3332 while True:
3333 l = iplib.raw_input_original(':')
3333 l = interactiveshell.raw_input_original(':')
3334 3334 if l == sentinel:
3335 3335 return
3336 3336 else:
@@ -210,7 +210,7 b' class PrefilterManager(Configurable):'
210 210 """
211 211
212 212 multi_line_specials = CBool(True, config=True)
213 shell = Instance('IPython.core.iplib.InteractiveShellABC')
213 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
214 214
215 215 def __init__(self, shell=None, config=None):
216 216 super(PrefilterManager, self).__init__(shell=shell, config=config)
@@ -453,7 +453,7 b' class PrefilterTransformer(Configurable):'
453 453 priority = Int(100, config=True)
454 454 # Transformers don't currently use shell or prefilter_manager, but as we
455 455 # move away from checkers and handlers, they will need them.
456 shell = Instance('IPython.core.iplib.InteractiveShellABC')
456 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
457 457 prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager')
458 458 enabled = Bool(True, config=True)
459 459
@@ -561,7 +561,7 b' class PrefilterChecker(Configurable):'
561 561 """Inspect an input line and return a handler for that line."""
562 562
563 563 priority = Int(100, config=True)
564 shell = Instance('IPython.core.iplib.InteractiveShellABC')
564 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
565 565 prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager')
566 566 enabled = Bool(True, config=True)
567 567
@@ -754,7 +754,7 b' class PrefilterHandler(Configurable):'
754 754
755 755 handler_name = Str('normal')
756 756 esc_strings = List([])
757 shell = Instance('IPython.core.iplib.InteractiveShellABC')
757 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
758 758 prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager')
759 759
760 760 def __init__(self, shell=None, prefilter_manager=None, config=None):
@@ -30,7 +30,7 b' import re'
30 30 # RegExp for splitting line contents into pre-char//first word-method//rest.
31 31 # For clarity, each group in on one line.
32 32
33 # WARNING: update the regexp if the escapes in iplib are changed, as they
33 # WARNING: update the regexp if the escapes in interactiveshell are changed, as they
34 34 # are hardwired in.
35 35
36 36 # Although it's not solely driven by the regex, note that:
@@ -25,8 +25,8 b' def test_import_hooks():'
25 25 def test_import_ipapi():
26 26 from IPython.core import ipapi
27 27
28 def test_import_iplib():
29 from IPython.core import iplib
28 def test_import_interactiveshell():
29 from IPython.core import interactiveshell
30 30
31 31 def test_import_logger():
32 32 from IPython.core import logger
@@ -1,4 +1,4 b''
1 """Tests for the key iplib module, where the main ipython class is defined.
1 """Tests for the key interactiveshell module, where the main ipython class is defined.
2 2 """
3 3 #-----------------------------------------------------------------------------
4 4 # Module imports
@@ -60,7 +60,7 b' def test_reset():'
60 60
61 61
62 62 # Tests for reporting of exceptions in various modes, handling of SystemExit,
63 # and %tb functionality. This is really a mix of testing ultraTB and iplib.
63 # and %tb functionality. This is really a mix of testing ultraTB and interactiveshell.
64 64
65 65 def doctest_tb_plain():
66 66 """
1 NO CONTENT: file renamed from IPython/Shell.py to IPython/deathrow/Shell.py
1 NO CONTENT: file renamed from IPython/iplib.py to IPython/deathrow/iplib.py
1 NO CONTENT: file renamed from IPython/scripts/ipython-wx to IPython/deathrow/ipython-wx
1 NO CONTENT: file renamed from IPython/scripts/ipythonx to IPython/deathrow/ipythonx
@@ -36,7 +36,7 b' class ParalleMagic(Plugin):'
36 36
37 37 active_multiengine_client = Any()
38 38 verbose = Bool(False, config=True)
39 shell = Instance('IPython.core.iplib.InteractiveShellABC')
39 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
40 40
41 41 def __init__(self, shell=None, config=None):
42 42 super(ParalleMagic, self).__init__(shell=shell, config=config)
@@ -55,7 +55,7 b' class PrettyResultDisplay(Plugin):'
55 55 """A component for pretty printing on steroids."""
56 56
57 57 verbose = Bool(False, config=True)
58 shell = Instance('IPython.core.iplib.InteractiveShellABC')
58 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
59 59
60 60 # A list of (type, func_name), like
61 61 # [(dict, 'my_dict_printer')]
@@ -18,7 +18,7 b' Simple tests for :mod:`IPython.extensions.pretty`.'
18 18 from unittest import TestCase
19 19
20 20 from IPython.config.configurable import Configurable
21 from IPython.core.iplib import InteractiveShellABC
21 from IPython.core.interactiveshell import InteractiveShellABC
22 22 from IPython.extensions import pretty as pretty_ext
23 23 from IPython.external import pretty
24 24 from IPython.testing import decorators as dec
@@ -30,8 +30,8 b' import sys'
30 30 from contextlib import nested
31 31
32 32 from IPython.core import ultratb
33 from IPython.core.iplib import InteractiveShell
34 from IPython.core.ipapp import load_default_config
33 from IPython.core.interactiveshell import InteractiveShell
34 from IPython.frontend.terminal.ipapp import load_default_config
35 35
36 36 from IPython.utils.traitlets import Bool, Str, CBool
37 37 from IPython.utils.io import ask_yes_no
@@ -31,14 +31,14 b' import sys'
31 31 from IPython.core import release
32 32 from IPython.core.crashhandler import CrashHandler
33 33 from IPython.core.application import Application, BaseAppConfigLoader
34 from IPython.core.iplib import InteractiveShell
34 from IPython.core.interactiveshell import InteractiveShell
35 35 from IPython.config.loader import (
36 36 Config,
37 37 PyFileConfigLoader
38 38 )
39 39 from IPython.lib import inputhook
40 40 from IPython.utils.path import filefind, get_ipython_dir
41 from . import usage
41 from IPython.core import usage
42 42
43 43 #-----------------------------------------------------------------------------
44 44 # Globals, utilities and helpers
@@ -1,6 +1,6 b''
1 1 #!/usr/bin/env python
2 2 # -*- coding: utf-8 -*-
3 3
4 from IPython.core.ipapp import launch_new_instance
4 from IPython.frontend.terminal.ipapp import launch_new_instance
5 5
6 6 launch_new_instance()
@@ -115,7 +115,7 b' def start_ipython():'
115 115 start_ipython.already_called = True
116 116
117 117 # Ok, first time we're called, go ahead
118 from IPython.core import iplib
118 from IPython.core import interactiveshell
119 119
120 120 def xsys(cmd):
121 121 """Execute a command and print its output.
@@ -136,7 +136,7 b' def start_ipython():'
136 136 config = tools.default_config()
137 137
138 138 # Create and initialize our test-friendly IPython instance.
139 shell = iplib.InteractiveShell.instance(
139 shell = interactiveshell.InteractiveShell.instance(
140 140 config=config,
141 141 user_ns=ipnsdict(), user_global_ns={}
142 142 )
@@ -153,10 +153,6 b' def make_exclude():'
153 153 ipjoin = lambda *paths: pjoin('IPython', *paths)
154 154
155 155 exclusions = [ipjoin('external'),
156 # Deprecated old Shell and iplib modules, skip to avoid
157 # warnings
158 ipjoin('Shell'),
159 ipjoin('iplib'),
160 156 pjoin('IPython_doctest_plugin'),
161 157 ipjoin('quarantine'),
162 158 ipjoin('deathrow'),
@@ -8,7 +8,7 b' NOSE=nosetests -vvs --with-ipdoctest --doctest-tests --doctest-extension=txt \\'
8 8 SRC=ipdoctest.py setup.py ../decorators.py
9 9
10 10 # Default target for clean 'make'
11 default: iplib
11 default: interactiveshell
12 12
13 13 # The actual plugin installation
14 14 plugin: IPython_doctest_plugin.egg-info
@@ -39,8 +39,8 b' magic: plugin'
39 39 excolors: plugin
40 40 $(NOSE) IPython.core.excolors
41 41
42 iplib: plugin
43 $(NOSE) IPython.core.iplib
42 interactiveshell: plugin
43 $(NOSE) IPython.core.interactiveshell
44 44
45 45 strd: plugin
46 46 $(NOSE) IPython.core.strdispatch
@@ -61,7 +61,7 b' sr: rtest strd'
61 61
62 62 base: dtest rtest test strd deco
63 63
64 quick: base iplib ipipe
64 quick: base interactiveshell ipipe
65 65
66 66 all: base ipython
67 67
@@ -77,7 +77,7 b' def find_cmd(cmd):'
77 77
78 78 from IPython.utils.path import get_ipython_module_path
79 79 from IPython.utils.process import pycmd2argv
80 argv = pycmd2argv(get_ipython_module_path('IPython.core.ipapp'))
80 argv = pycmd2argv(get_ipython_module_path('IPython.frontend.terminal.ipapp'))
81 81
82 82 Parameters
83 83 ----------
@@ -255,7 +255,7 b' def test_get_ipython_package_dir():'
255 255
256 256
257 257 def test_get_ipython_module_path():
258 ipapp_path = path.get_ipython_module_path('IPython.core.ipapp')
258 ipapp_path = path.get_ipython_module_path('IPython.frontend.terminal.ipapp')
259 259 nt.assert_true(os.path.isfile(ipapp_path))
260 260
261 261
@@ -27,7 +27,7 b' import zmq'
27 27
28 28 # Local imports.
29 29 from IPython.config.configurable import Configurable
30 from IPython.core.iplib import InteractiveShell, InteractiveShellABC
30 from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC
31 31 from IPython.external.argparse import ArgumentParser
32 32 from IPython.utils.traitlets import Instance
33 33 from IPython.zmq.session import Session, Message
@@ -42,7 +42,7 b' from exitpoller import ExitPollerUnix, ExitPollerWindows'
42 42
43 43 class Kernel(Configurable):
44 44
45 shell = Instance('IPython.core.iplib.InteractiveShellABC')
45 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
46 46 session = Instance('IPython.zmq.session.Session')
47 47 reply_socket = Instance('zmq.Socket')
48 48 pub_socket = Instance('zmq.Socket')
@@ -13,4 +13,6 b' this_dir = os.path.dirname(os.path.abspath(__file__))'
13 13 sys.path.insert(0, this_dir)
14 14
15 15 # Now proceed with execution
16 execfile(os.path.join(this_dir, 'IPython', 'scripts', 'ipython'))
16 execfile(os.path.join(
17 this_dir, 'IPython', 'frontend', 'terminal', 'scripts', 'ipython'
18 ))
@@ -35,8 +35,6 b' def install():'
35 35 'ipcontroller',
36 36 'ipengine',
37 37 'ipcluster',
38 'ipythonx',
39 'ipython-wx',
40 38 'irunner'
41 39 ]
42 40 scripts = pjoin(prefix,'scripts')
@@ -207,12 +207,11 b" if 'setuptools' in sys.modules:"
207 207 setuptools_extra_args['zip_safe'] = False
208 208 setuptools_extra_args['entry_points'] = {
209 209 'console_scripts': [
210 'ipython = IPython.core.ipapp:launch_new_instance',
210 'ipython = IPython.frontend.terminal.ipapp:launch_new_instance',
211 211 'pycolor = IPython.utils.PyColorize:main',
212 212 'ipcontroller = IPython.kernel.ipcontrollerapp:launch_new_instance',
213 213 'ipengine = IPython.kernel.ipengineapp:launch_new_instance',
214 214 'ipcluster = IPython.kernel.ipclusterapp:launch_new_instance',
215 'ipythonx = IPython.frontend.wx.ipythonx:main',
216 215 'iptest = IPython.testing.iptest:main',
217 216 'irunner = IPython.lib.irunner:main'
218 217 ]
@@ -111,6 +111,7 b' def find_packages():'
111 111 add_package(packages, 'frontend')
112 112 add_package(packages, 'frontend.qt')
113 113 add_package(packages, 'frontend.qt.console')
114 add_package(packages, 'frontend.terminal', config=False, tests=True, scripts=True)
114 115 add_package(packages, 'kernel', config=False, tests=True, scripts=True)
115 116 add_package(packages, 'kernel.core', config=False, tests=True)
116 117 add_package(packages, 'lib', tests=True)
@@ -254,12 +255,11 b' def find_scripts():'
254 255 """
255 256 kernel_scripts = pjoin('IPython','kernel','scripts')
256 257 main_scripts = pjoin('IPython','scripts')
258 frontend_terminal_scripts = pjoin('IPython','frontend','terminal','scripts')
257 259 scripts = [pjoin(kernel_scripts, 'ipengine'),
258 260 pjoin(kernel_scripts, 'ipcontroller'),
259 261 pjoin(kernel_scripts, 'ipcluster'),
260 pjoin(main_scripts, 'ipython'),
261 pjoin(main_scripts, 'ipythonx'),
262 pjoin(main_scripts, 'ipython-wx'),
262 pjoin(frontend_terminal_scripts, 'ipython'),
263 263 pjoin(main_scripts, 'pycolor'),
264 264 pjoin(main_scripts, 'irunner'),
265 265 pjoin(main_scripts, 'iptest')
General Comments 0
You need to be logged in to leave comments. Login now