Show More
@@ -13,16 +13,18 b' warn("The `IPython.kernel` package has been deprecated. "' | |||||
13 |
|
13 | |||
14 | from IPython.utils.shimmodule import ShimModule |
|
14 | from IPython.utils.shimmodule import ShimModule | |
15 |
|
15 | |||
16 | # session moved relative to top-level |
|
16 | # zmq subdir is gone | |
17 | sys.modules['IPython.kernel.zmq.session'] = ShimModule('session', mirror='jupyter_client.session') |
|
17 | sys.modules['IPython.kernel.zmq.session'] = ShimModule('session', mirror='jupyter_client.session') | |
|
18 | sys.modules['IPython.kernel.zmq'] = ShimModule('zmq', mirror='ipython_kernel') | |||
18 |
|
19 | |||
19 |
for pkg in ('comm', 'inprocess', 'resources' |
|
20 | for pkg in ('comm', 'inprocess', 'resources'): | |
20 | sys.modules['IPython.kernel.%s' % pkg] = ShimModule(pkg, mirror='ipython_kernel.%s' % pkg) |
|
21 | sys.modules['IPython.kernel.%s' % pkg] = ShimModule(pkg, mirror='ipython_kernel.%s' % pkg) | |
|
22 | ||||
21 | for pkg in ('ioloop', 'blocking'): |
|
23 | for pkg in ('ioloop', 'blocking'): | |
22 | sys.modules['IPython.kernel.%s' % pkg] = ShimModule(pkg, mirror='jupyter_client.%s' % pkg) |
|
24 | sys.modules['IPython.kernel.%s' % pkg] = ShimModule(pkg, mirror='jupyter_client.%s' % pkg) | |
23 |
|
25 | |||
24 | # required for `from IPython.kernel import PKG` |
|
26 | # required for `from IPython.kernel import PKG` | |
25 |
from ipython_kernel import comm, inprocess, resources |
|
27 | from ipython_kernel import comm, inprocess, resources | |
26 | from jupyter_client import ioloop, blocking |
|
28 | from jupyter_client import ioloop, blocking | |
27 | # public API |
|
29 | # public API | |
28 | from ipython_kernel.connect import * |
|
30 | from ipython_kernel.connect import * |
@@ -232,10 +232,10 b" sec.requires('zmq')" | |||||
232 | # The in-process kernel tests are done in a separate section |
|
232 | # The in-process kernel tests are done in a separate section | |
233 | sec.exclude('inprocess') |
|
233 | sec.exclude('inprocess') | |
234 | # importing gtk sets the default encoding, which we want to avoid |
|
234 | # importing gtk sets the default encoding, which we want to avoid | |
235 |
sec.exclude(' |
|
235 | sec.exclude('gui.gtkembed') | |
236 |
sec.exclude(' |
|
236 | sec.exclude('gui.gtk3embed') | |
237 | if not have['matplotlib']: |
|
237 | if not have['matplotlib']: | |
238 |
sec.exclude(' |
|
238 | sec.exclude('pylab') | |
239 |
|
239 | |||
240 | # kernel.inprocess: |
|
240 | # kernel.inprocess: | |
241 | test_sections['kernel.inprocess'].requires('zmq') |
|
241 | test_sections['kernel.inprocess'].requires('zmq') |
@@ -1,3 +1,3 b'' | |||||
1 | if __name__ == '__main__': |
|
1 | if __name__ == '__main__': | |
2 |
from ipython_kernel |
|
2 | from ipython_kernel import kernelapp as app | |
3 | app.launch_new_instance() |
|
3 | app.launch_new_instance() |
@@ -9,7 +9,7 b' import uuid' | |||||
9 | from zmq.eventloop.ioloop import IOLoop |
|
9 | from zmq.eventloop.ioloop import IOLoop | |
10 |
|
10 | |||
11 | from IPython.config import LoggingConfigurable |
|
11 | from IPython.config import LoggingConfigurable | |
12 |
from ipython_kernel |
|
12 | from ipython_kernel.kernelbase import Kernel | |
13 |
|
13 | |||
14 | from IPython.utils.jsonutil import json_clean |
|
14 | from IPython.utils.jsonutil import json_clean | |
15 | from IPython.utils.traitlets import Instance, Unicode, Bytes, Bool, Dict, Any |
|
15 | from IPython.utils.traitlets import Instance, Unicode, Bytes, Bool, Dict, Any | |
@@ -20,7 +20,7 b' class Comm(LoggingConfigurable):' | |||||
20 | # If this is instantiated by a non-IPython kernel, shell will be None |
|
20 | # If this is instantiated by a non-IPython kernel, shell will be None | |
21 | shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', |
|
21 | shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', | |
22 | allow_none=True) |
|
22 | allow_none=True) | |
23 |
kernel = Instance('ipython_kernel. |
|
23 | kernel = Instance('ipython_kernel.kernelbase.Kernel') | |
24 | def _kernel_default(self): |
|
24 | def _kernel_default(self): | |
25 | if Kernel.initialized(): |
|
25 | if Kernel.initialized(): | |
26 | return Kernel.instance() |
|
26 | return Kernel.instance() | |
@@ -28,7 +28,7 b' class Comm(LoggingConfigurable):' | |||||
28 | iopub_socket = Any() |
|
28 | iopub_socket = Any() | |
29 | def _iopub_socket_default(self): |
|
29 | def _iopub_socket_default(self): | |
30 | return self.kernel.iopub_socket |
|
30 | return self.kernel.iopub_socket | |
31 |
session = Instance('ipython_kernel. |
|
31 | session = Instance('ipython_kernel.session.Session') | |
32 | def _session_default(self): |
|
32 | def _session_default(self): | |
33 | if self.kernel is not None: |
|
33 | if self.kernel is not None: | |
34 | return self.kernel.session |
|
34 | return self.kernel.session |
@@ -31,12 +31,12 b' class CommManager(LoggingConfigurable):' | |||||
31 | # If this is instantiated by a non-IPython kernel, shell will be None |
|
31 | # If this is instantiated by a non-IPython kernel, shell will be None | |
32 | shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', |
|
32 | shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', | |
33 | allow_none=True) |
|
33 | allow_none=True) | |
34 |
kernel = Instance('ipython_kernel. |
|
34 | kernel = Instance('ipython_kernel.kernelbase.Kernel') | |
35 |
|
35 | |||
36 | iopub_socket = Any() |
|
36 | iopub_socket = Any() | |
37 | def _iopub_socket_default(self): |
|
37 | def _iopub_socket_default(self): | |
38 | return self.kernel.iopub_socket |
|
38 | return self.kernel.iopub_socket | |
39 |
session = Instance('ipython_kernel. |
|
39 | session = Instance('ipython_kernel.session.Session') | |
40 | def _session_default(self): |
|
40 | def _session_default(self): | |
41 | return self.kernel.session |
|
41 | return self.kernel.session | |
42 |
|
42 |
@@ -16,8 +16,8 b' from IPython.config import Configurable' | |||||
16 | from ipython_kernel.inprocess.socket import SocketABC |
|
16 | from ipython_kernel.inprocess.socket import SocketABC | |
17 | from IPython.utils.jsonutil import json_clean |
|
17 | from IPython.utils.jsonutil import json_clean | |
18 | from IPython.utils.traitlets import Instance, Dict, CBytes |
|
18 | from IPython.utils.traitlets import Instance, Dict, CBytes | |
19 |
from ipython_kernel |
|
19 | from ipython_kernel.serialize import serialize_object | |
20 |
from ipython_kernel |
|
20 | from ipython_kernel.session import Session, extract_header | |
21 |
|
21 | |||
22 | #----------------------------------------------------------------------------- |
|
22 | #----------------------------------------------------------------------------- | |
23 | # Code |
|
23 | # Code | |
@@ -66,5 +66,5 b' def publish_data(data):' | |||||
66 | data : dict |
|
66 | data : dict | |
67 | The data to be published. Think of it as a namespace. |
|
67 | The data to be published. Think of it as a namespace. | |
68 | """ |
|
68 | """ | |
69 |
from ipython_kernel |
|
69 | from ipython_kernel.zmqshell import ZMQInteractiveShell | |
70 | ZMQInteractiveShell.instance().data_pub.publish_data(data) |
|
70 | ZMQInteractiveShell.instance().data_pub.publish_data(data) |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/displayhook.py to ipython_kernel/displayhook.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/displayhook.py to ipython_kernel/displayhook.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/embed.py to ipython_kernel/embed.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/embed.py to ipython_kernel/embed.py |
@@ -49,7 +49,7 b' def register_integration(*toolkitnames):' | |||||
49 | instance, arrange for the event loop to call ``kernel.do_one_iteration()`` |
|
49 | instance, arrange for the event loop to call ``kernel.do_one_iteration()`` | |
50 | at least every ``kernel._poll_interval`` seconds, and start the event loop. |
|
50 | at least every ``kernel._poll_interval`` seconds, and start the event loop. | |
51 |
|
51 | |||
52 |
:mod:`ipython_kernel. |
|
52 | :mod:`ipython_kernel.eventloops` provides and registers such functions | |
53 | for a few common event loops. |
|
53 | for a few common event loops. | |
54 | """ |
|
54 | """ | |
55 | def decorator(func): |
|
55 | def decorator(func): |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/gui/__init__.py to ipython_kernel/gui/__init__.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/gui/__init__.py to ipython_kernel/gui/__init__.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/gui/gtk3embed.py to ipython_kernel/gui/gtk3embed.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/gui/gtk3embed.py to ipython_kernel/gui/gtk3embed.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/gui/gtkembed.py to ipython_kernel/gui/gtkembed.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/gui/gtkembed.py to ipython_kernel/gui/gtkembed.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/heartbeat.py to ipython_kernel/heartbeat.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/heartbeat.py to ipython_kernel/heartbeat.py |
@@ -10,8 +10,8 b' import sys' | |||||
10 | from IPython.core.interactiveshell import InteractiveShellABC |
|
10 | from IPython.core.interactiveshell import InteractiveShellABC | |
11 | from IPython.utils.jsonutil import json_clean |
|
11 | from IPython.utils.jsonutil import json_clean | |
12 | from IPython.utils.traitlets import Any, Enum, Instance, List, Type |
|
12 | from IPython.utils.traitlets import Any, Enum, Instance, List, Type | |
13 |
from ipython_kernel |
|
13 | from ipython_kernel.ipkernel import IPythonKernel | |
14 |
from ipython_kernel |
|
14 | from ipython_kernel.zmqshell import ZMQInteractiveShell | |
15 |
|
15 | |||
16 | from .socket import DummySocket |
|
16 | from .socket import DummySocket | |
17 |
|
17 | |||
@@ -121,18 +121,18 b' class InProcessKernel(IPythonKernel):' | |||||
121 | return logging.getLogger(__name__) |
|
121 | return logging.getLogger(__name__) | |
122 |
|
122 | |||
123 | def _session_default(self): |
|
123 | def _session_default(self): | |
124 |
from ipython_kernel |
|
124 | from ipython_kernel.session import Session | |
125 | return Session(parent=self, key=b'') |
|
125 | return Session(parent=self, key=b'') | |
126 |
|
126 | |||
127 | def _shell_class_default(self): |
|
127 | def _shell_class_default(self): | |
128 | return InProcessInteractiveShell |
|
128 | return InProcessInteractiveShell | |
129 |
|
129 | |||
130 | def _stdout_default(self): |
|
130 | def _stdout_default(self): | |
131 |
from ipython_kernel |
|
131 | from ipython_kernel.iostream import OutStream | |
132 | return OutStream(self.session, self.iopub_socket, u'stdout', pipe=False) |
|
132 | return OutStream(self.session, self.iopub_socket, u'stdout', pipe=False) | |
133 |
|
133 | |||
134 | def _stderr_default(self): |
|
134 | def _stderr_default(self): | |
135 |
from ipython_kernel |
|
135 | from ipython_kernel.iostream import OutStream | |
136 | return OutStream(self.session, self.iopub_socket, u'stderr', pipe=False) |
|
136 | return OutStream(self.session, self.iopub_socket, u'stderr', pipe=False) | |
137 |
|
137 | |||
138 | #----------------------------------------------------------------------------- |
|
138 | #----------------------------------------------------------------------------- | |
@@ -150,7 +150,7 b' class InProcessInteractiveShell(ZMQInteractiveShell):' | |||||
150 |
|
150 | |||
151 | def enable_gui(self, gui=None): |
|
151 | def enable_gui(self, gui=None): | |
152 | """Enable GUI integration for the kernel.""" |
|
152 | """Enable GUI integration for the kernel.""" | |
153 |
from ipython_kernel |
|
153 | from ipython_kernel.eventloops import enable_gui | |
154 | if not gui: |
|
154 | if not gui: | |
155 | gui = self.kernel.gui |
|
155 | gui = self.kernel.gui | |
156 | return enable_gui(gui, kernel=self.kernel) |
|
156 | return enable_gui(gui, kernel=self.kernel) |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/iostream.py to ipython_kernel/iostream.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/iostream.py to ipython_kernel/iostream.py |
@@ -10,7 +10,7 b' from IPython.utils.tokenutil import token_at_cursor, line_at_cursor' | |||||
10 | from IPython.utils.traitlets import Instance, Type, Any, List |
|
10 | from IPython.utils.traitlets import Instance, Type, Any, List | |
11 | from IPython.utils.decorators import undoc |
|
11 | from IPython.utils.decorators import undoc | |
12 |
|
12 | |||
13 |
from |
|
13 | from .comm import CommManager | |
14 | from .kernelbase import Kernel as KernelBase |
|
14 | from .kernelbase import Kernel as KernelBase | |
15 | from .serialize import serialize_object, unpack_apply_message |
|
15 | from .serialize import serialize_object, unpack_apply_message | |
16 | from .zmqshell import ZMQInteractiveShell |
|
16 | from .zmqshell import ZMQInteractiveShell | |
@@ -363,6 +363,6 b' class IPythonKernel(KernelBase):' | |||||
363 | class Kernel(IPythonKernel): |
|
363 | class Kernel(IPythonKernel): | |
364 | def __init__(self, *args, **kwargs): |
|
364 | def __init__(self, *args, **kwargs): | |
365 | import warnings |
|
365 | import warnings | |
366 |
warnings.warn('Kernel is a deprecated alias of ipython_kernel. |
|
366 | warnings.warn('Kernel is a deprecated alias of ipython_kernel.ipkernel.IPythonKernel', | |
367 | DeprecationWarning) |
|
367 | DeprecationWarning) | |
368 | super(Kernel, self).__init__(*args, **kwargs) |
|
368 | super(Kernel, self).__init__(*args, **kwargs) |
@@ -99,8 +99,8 b' class IPKernelApp(BaseIPythonApplication, InteractiveShellApp,' | |||||
99 | flags = Dict(kernel_flags) |
|
99 | flags = Dict(kernel_flags) | |
100 | classes = [IPythonKernel, ZMQInteractiveShell, ProfileDir, Session] |
|
100 | classes = [IPythonKernel, ZMQInteractiveShell, ProfileDir, Session] | |
101 | # the kernel class, as an importstring |
|
101 | # the kernel class, as an importstring | |
102 |
kernel_class = Type('ipython_kernel. |
|
102 | kernel_class = Type('ipython_kernel.ipkernel.IPythonKernel', config=True, | |
103 |
klass='ipython_kernel. |
|
103 | klass='ipython_kernel.kernelbase.Kernel', | |
104 | help="""The Kernel subclass to be used. |
|
104 | help="""The Kernel subclass to be used. | |
105 |
|
105 | |||
106 | This should allow easy re-use of the IPKernelApp entry point |
|
106 | This should allow easy re-use of the IPKernelApp entry point | |
@@ -124,9 +124,9 b' class IPKernelApp(BaseIPythonApplication, InteractiveShellApp,' | |||||
124 | # streams, etc. |
|
124 | # streams, etc. | |
125 | no_stdout = Bool(False, config=True, help="redirect stdout to the null device") |
|
125 | no_stdout = Bool(False, config=True, help="redirect stdout to the null device") | |
126 | no_stderr = Bool(False, config=True, help="redirect stderr to the null device") |
|
126 | no_stderr = Bool(False, config=True, help="redirect stderr to the null device") | |
127 |
outstream_class = DottedObjectName('ipython_kernel. |
|
127 | outstream_class = DottedObjectName('ipython_kernel.iostream.OutStream', | |
128 | config=True, help="The importstring for the OutStream factory") |
|
128 | config=True, help="The importstring for the OutStream factory") | |
129 |
displayhook_class = DottedObjectName('ipython_kernel. |
|
129 | displayhook_class = DottedObjectName('ipython_kernel.displayhook.ZMQDisplayHook', | |
130 | config=True, help="The importstring for the DisplayHook factory") |
|
130 | config=True, help="The importstring for the DisplayHook factory") | |
131 |
|
131 | |||
132 | # polling |
|
132 | # polling |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/kernelbase.py to ipython_kernel/kernelbase.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/kernelbase.py to ipython_kernel/kernelbase.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/log.py to ipython_kernel/log.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/log.py to ipython_kernel/log.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/parentpoller.py to ipython_kernel/parentpoller.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/parentpoller.py to ipython_kernel/parentpoller.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/pylab/__init__.py to ipython_kernel/pylab/__init__.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/pylab/__init__.py to ipython_kernel/pylab/__init__.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/pylab/backend_inline.py to ipython_kernel/pylab/backend_inline.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/pylab/backend_inline.py to ipython_kernel/pylab/backend_inline.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/pylab/config.py to ipython_kernel/pylab/config.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/pylab/config.py to ipython_kernel/pylab/config.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/serialize.py to ipython_kernel/serialize.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/serialize.py to ipython_kernel/serialize.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/session.py to ipython_kernel/session.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/session.py to ipython_kernel/session.py |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/tests/test_embed_kernel.py to ipython_kernel/tests/test_embed_kernel.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/tests/test_embed_kernel.py to ipython_kernel/tests/test_embed_kernel.py |
@@ -9,7 +9,7 b' from collections import namedtuple' | |||||
9 | import nose.tools as nt |
|
9 | import nose.tools as nt | |
10 |
|
10 | |||
11 | # from unittest import TestCaes |
|
11 | # from unittest import TestCaes | |
12 |
from ipython_kernel |
|
12 | from ipython_kernel.serialize import serialize_object, deserialize_object | |
13 | from IPython.testing import decorators as dec |
|
13 | from IPython.testing import decorators as dec | |
14 | from IPython.utils.pickleutil import CannedArray, CannedClass |
|
14 | from IPython.utils.pickleutil import CannedArray, CannedClass | |
15 | from IPython.utils.py3compat import iteritems |
|
15 | from IPython.utils.py3compat import iteritems |
1 | NO CONTENT: file renamed from ipython_kernel/zmq/tests/test_start_kernel.py to ipython_kernel/tests/test_start_kernel.py |
|
NO CONTENT: file renamed from ipython_kernel/zmq/tests/test_start_kernel.py to ipython_kernel/tests/test_start_kernel.py |
@@ -46,9 +46,9 b' from IPython.utils import py3compat' | |||||
46 | from IPython.utils.py3compat import unicode_type |
|
46 | from IPython.utils.py3compat import unicode_type | |
47 | from IPython.utils.traitlets import Instance, Type, Dict, CBool, CBytes, Any |
|
47 | from IPython.utils.traitlets import Instance, Type, Dict, CBool, CBytes, Any | |
48 | from IPython.utils.warn import error |
|
48 | from IPython.utils.warn import error | |
49 |
from ipython_kernel |
|
49 | from ipython_kernel.displayhook import ZMQShellDisplayHook | |
50 |
from ipython_kernel |
|
50 | from ipython_kernel.datapub import ZMQDataPublisher | |
51 |
from ipython_kernel |
|
51 | from ipython_kernel.session import extract_header | |
52 | from .session import Session |
|
52 | from .session import Session | |
53 |
|
53 | |||
54 | #----------------------------------------------------------------------------- |
|
54 | #----------------------------------------------------------------------------- |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now