##// END OF EJS Templates
s/IPython.kernel/jupyter_client in jupyter_client
Min RK -
Show More
@@ -1,8 +1,5 b''
1 """IPython kernels and associated utilities"""
1 """IPython kernels and associated utilities"""
2
2
3 # just for friendlier zmq version check
4 from . import zmq
5
6 from .connect import *
3 from .connect import *
7 from .launcher import *
4 from .launcher import *
8 from .client import KernelClient
5 from .client import KernelClient
@@ -11,8 +11,8 b' except ImportError:'
11 from Queue import Empty # Python 2
11 from Queue import Empty # Python 2
12
12
13 from IPython.utils.traitlets import Type
13 from IPython.utils.traitlets import Type
14 from IPython.kernel.channels import HBChannel
14 from jupyter_client.channels import HBChannel
15 from IPython.kernel.client import KernelClient
15 from jupyter_client.client import KernelClient
16 from .channels import ZMQSocketChannel
16 from .channels import ZMQSocketChannel
17
17
18 class BlockingKernelClient(KernelClient):
18 class BlockingKernelClient(KernelClient):
@@ -29,7 +29,7 b' class HBChannelABC(ChannelABC):'
29
29
30 The docstrings for this class can be found in the base implementation:
30 The docstrings for this class can be found in the base implementation:
31
31
32 `IPython.kernel.channels.HBChannel`
32 `jupyter_client.channels.HBChannel`
33 """
33 """
34
34
35 @abc.abstractproperty
35 @abc.abstractproperty
@@ -4,7 +4,7 b''
4 # Distributed under the terms of the Modified BSD License.
4 # Distributed under the terms of the Modified BSD License.
5
5
6 from __future__ import absolute_import
6 from __future__ import absolute_import
7 from IPython.kernel.channels import major_protocol_version
7 from jupyter_client.channels import major_protocol_version
8 from IPython.utils.py3compat import string_types, iteritems
8 from IPython.utils.py3compat import string_types, iteritems
9
9
10 import zmq
10 import zmq
@@ -24,7 +24,7 b' class KernelClientABC(with_metaclass(abc.ABCMeta, object)):'
24
24
25 The docstrings for this class can be found in the base implementation:
25 The docstrings for this class can be found in the base implementation:
26
26
27 `IPython.kernel.client.KernelClient`
27 `jupyter_client.client.KernelClient`
28 """
28 """
29
29
30 @abc.abstractproperty
30 @abc.abstractproperty
@@ -151,7 +151,7 b' def get_connection_file(app=None):'
151 If unspecified, the currently running app will be used
151 If unspecified, the currently running app will be used
152 """
152 """
153 if app is None:
153 if app is None:
154 from IPython.kernel.zmq.kernelapp import IPKernelApp
154 from jupyter_client.kernelapp import IPKernelApp
155 if not IPKernelApp.initialized():
155 if not IPKernelApp.initialized():
156 raise RuntimeError("app not specified, and not in a running Kernel")
156 raise RuntimeError("app not specified, and not in a running Kernel")
157
157
@@ -432,9 +432,9 b' class ConnectionFileMixin(LoggingConfigurable):'
432 return [ getattr(self, name) for name in port_names ]
432 return [ getattr(self, name) for name in port_names ]
433
433
434 # The Session to use for communication with the kernel.
434 # The Session to use for communication with the kernel.
435 session = Instance('IPython.kernel.zmq.session.Session')
435 session = Instance('jupyter_client.session.Session')
436 def _session_default(self):
436 def _session_default(self):
437 from IPython.kernel.zmq.session import Session
437 from jupyter_client.session import Session
438 return Session(parent=self)
438 return Session(parent=self)
439
439
440 #--------------------------------------------------------------------------
440 #--------------------------------------------------------------------------
@@ -20,7 +20,7 b' from IPython.utils.traitlets import ('
20 Instance
20 Instance
21 )
21 )
22
22
23 from IPython.kernel.manager import KernelManager
23 from jupyter_client.manager import KernelManager
24 from .restarter import IOLoopKernelRestarter
24 from .restarter import IOLoopKernelRestarter
25
25
26 #-----------------------------------------------------------------------------
26 #-----------------------------------------------------------------------------
@@ -40,7 +40,7 b' class IOLoopKernelManager(KernelManager):'
40 def _loop_default(self):
40 def _loop_default(self):
41 return ioloop.IOLoop.instance()
41 return ioloop.IOLoop.instance()
42
42
43 _restarter = Instance('IPython.kernel.ioloop.IOLoopKernelRestarter', allow_none=True)
43 _restarter = Instance('jupyter_client.ioloop.IOLoopKernelRestarter', allow_none=True)
44
44
45 def start_restarter(self):
45 def start_restarter(self):
46 if self.autorestart and self.has_kernel:
46 if self.autorestart and self.has_kernel:
@@ -20,7 +20,7 b' from __future__ import absolute_import'
20 from zmq.eventloop import ioloop
20 from zmq.eventloop import ioloop
21
21
22
22
23 from IPython.kernel.restarter import KernelRestarter
23 from jupyter_client.restarter import KernelRestarter
24 from IPython.utils.traitlets import (
24 from IPython.utils.traitlets import (
25 Instance,
25 Instance,
26 )
26 )
@@ -175,7 +175,7 b' def launch_kernel(cmd, stdin=None, stdout=None, stderr=None, env=None,'
175 cwd = cast_bytes_py2(cwd, sys.getfilesystemencoding() or 'ascii')
175 cwd = cast_bytes_py2(cwd, sys.getfilesystemencoding() or 'ascii')
176 kwargs['cwd'] = cwd
176 kwargs['cwd'] = cwd
177
177
178 from IPython.kernel.zmq.parentpoller import ParentPollerWindows
178 from jupyter_client.parentpoller import ParentPollerWindows
179 # Create a Win32 event for interrupting the kernel
179 # Create a Win32 event for interrupting the kernel
180 # and store it in an environment variable.
180 # and store it in an environment variable.
181 interrupt_event = ParentPollerWindows.create_interrupt_event()
181 interrupt_event = ParentPollerWindows.create_interrupt_event()
@@ -25,12 +25,12 b' from IPython.utils.path import get_ipython_dir'
25 from IPython.utils.traitlets import (
25 from IPython.utils.traitlets import (
26 Any, Instance, Unicode, List, Bool, Type, DottedObjectName
26 Any, Instance, Unicode, List, Bool, Type, DottedObjectName
27 )
27 )
28 from IPython.kernel import (
28 from jupyter_client import (
29 launch_kernel,
29 launch_kernel,
30 kernelspec,
30 kernelspec,
31 )
31 )
32 from .connect import ConnectionFileMixin
32 from .connect import ConnectionFileMixin
33 from .zmq.session import Session
33 from .session import Session
34 from .managerabc import (
34 from .managerabc import (
35 KernelManagerABC
35 KernelManagerABC
36 )
36 )
@@ -48,7 +48,7 b' class KernelManager(ConnectionFileMixin):'
48 return zmq.Context.instance()
48 return zmq.Context.instance()
49
49
50 # the class to create with our `client` method
50 # the class to create with our `client` method
51 client_class = DottedObjectName('IPython.kernel.blocking.BlockingKernelClient')
51 client_class = DottedObjectName('jupyter_client.blocking.BlockingKernelClient')
52 client_factory = Type(allow_none=True)
52 client_factory = Type(allow_none=True)
53 def _client_class_changed(self, name, old, new):
53 def _client_class_changed(self, name, old, new):
54 self.client_factory = import_item(str(new))
54 self.client_factory = import_item(str(new))
@@ -381,7 +381,7 b' class KernelManager(ConnectionFileMixin):'
381 """
381 """
382 if self.has_kernel:
382 if self.has_kernel:
383 if sys.platform == 'win32':
383 if sys.platform == 'win32':
384 from .zmq.parentpoller import ParentPollerWindows as Poller
384 from .parentpoller import ParentPollerWindows as Poller
385 Poller.send_interrupt(self.kernel.win32_interrupt_event)
385 Poller.send_interrupt(self.kernel.win32_interrupt_event)
386 else:
386 else:
387 self.kernel.send_signal(signal.SIGINT)
387 self.kernel.send_signal(signal.SIGINT)
@@ -13,7 +13,7 b' class KernelManagerABC(with_metaclass(abc.ABCMeta, object)):'
13
13
14 The docstrings for this class can be found in the base implementation:
14 The docstrings for this class can be found in the base implementation:
15
15
16 `IPython.kernel.kernelmanager.KernelManager`
16 `jupyter_client.kernelmanager.KernelManager`
17 """
17 """
18
18
19 @abc.abstractproperty
19 @abc.abstractproperty
@@ -49,7 +49,7 b' class MultiKernelManager(LoggingConfigurable):'
49 )
49 )
50
50
51 kernel_manager_class = DottedObjectName(
51 kernel_manager_class = DottedObjectName(
52 "IPython.kernel.ioloop.IOLoopKernelManager", config=True,
52 "jupyter_client.ioloop.IOLoopKernelManager", config=True,
53 help="""The kernel manager class. This is configurable to allow
53 help="""The kernel manager class. This is configurable to allow
54 subclassing of the KernelManager for customized behavior.
54 subclassing of the KernelManager for customized behavior.
55 """
55 """
@@ -18,7 +18,7 b' from IPython.utils.traitlets import ('
18 class KernelRestarter(LoggingConfigurable):
18 class KernelRestarter(LoggingConfigurable):
19 """Monitor and autorestart a kernel."""
19 """Monitor and autorestart a kernel."""
20
20
21 kernel_manager = Instance('IPython.kernel.KernelManager')
21 kernel_manager = Instance('jupyter_client.KernelManager')
22
22
23 debug = Bool(False, config=True,
23 debug = Bool(False, config=True,
24 help="""Whether to include every poll event in debugging output.
24 help="""Whether to include every poll event in debugging output.
@@ -53,8 +53,8 b' from IPython.utils.traitlets import (CBytes, Unicode, Bool, Any, Instance, Set,'
53 TraitError,
53 TraitError,
54 )
54 )
55 from IPython.utils.pickleutil import PICKLE_PROTOCOL
55 from IPython.utils.pickleutil import PICKLE_PROTOCOL
56 from IPython.kernel.adapter import adapt
57 from IPython.kernel.zmq.serialize import MAX_ITEMS, MAX_BYTES
56 from IPython.kernel.zmq.serialize import MAX_ITEMS, MAX_BYTES
57 from jupyter_client.adapter import adapt
58
58
59 #-----------------------------------------------------------------------------
59 #-----------------------------------------------------------------------------
60 # utility functions
60 # utility functions
@@ -148,7 +148,7 b' class SessionFactory(LoggingConfigurable):'
148 def _context_default(self):
148 def _context_default(self):
149 return zmq.Context.instance()
149 return zmq.Context.instance()
150
150
151 session = Instance('IPython.kernel.zmq.session.Session',
151 session = Instance('jupyter_client.session.Session',
152 allow_none=True)
152 allow_none=True)
153
153
154 loop = Instance('zmq.eventloop.ioloop.IOLoop')
154 loop = Instance('zmq.eventloop.ioloop.IOLoop')
@@ -8,8 +8,8 b' import json'
8 from unittest import TestCase
8 from unittest import TestCase
9 import nose.tools as nt
9 import nose.tools as nt
10
10
11 from IPython.kernel.adapter import adapt, V4toV5, V5toV4, code_to_line
11 from jupyter_client.adapter import adapt, V4toV5, V5toV4, code_to_line
12 from IPython.kernel.zmq.session import Session
12 from jupyter_client.session import Session
13
13
14
14
15 def test_default_version():
15 def test_default_version():
@@ -26,8 +26,8 b' from IPython.consoleapp import IPythonConsoleApp'
26 from IPython.core.application import BaseIPythonApplication
26 from IPython.core.application import BaseIPythonApplication
27 from IPython.utils.tempdir import TemporaryDirectory, TemporaryWorkingDirectory
27 from IPython.utils.tempdir import TemporaryDirectory, TemporaryWorkingDirectory
28 from IPython.utils.py3compat import str_to_bytes
28 from IPython.utils.py3compat import str_to_bytes
29 from IPython.kernel import connect
29 from jupyter_client import connect
30 from IPython.kernel.zmq.session import Session
30 from jupyter_client.session import Session
31
31
32 #-----------------------------------------------------------------------------
32 #-----------------------------------------------------------------------------
33 # Classes and functions
33 # Classes and functions
@@ -7,7 +7,7 b' from unittest import TestCase'
7 from IPython.testing import decorators as dec
7 from IPython.testing import decorators as dec
8
8
9 from IPython.config.loader import Config
9 from IPython.config.loader import Config
10 from IPython.kernel import KernelManager
10 from jupyter_client import KernelManager
11
11
12 class TestKernelManager(TestCase):
12 class TestKernelManager(TestCase):
13
13
@@ -5,7 +5,7 b' import unittest'
5
5
6 from IPython.testing.decorators import onlyif
6 from IPython.testing.decorators import onlyif
7 from IPython.utils.tempdir import TemporaryDirectory
7 from IPython.utils.tempdir import TemporaryDirectory
8 from IPython.kernel import kernelspec
8 from jupyter_client import kernelspec
9
9
10 sample_kernel_json = {'argv':['cat', '{connection_file}'],
10 sample_kernel_json = {'argv':['cat', '{connection_file}'],
11 'display_name':'Test kernel',
11 'display_name':'Test kernel',
@@ -20,7 +20,7 b' Authors'
20 import nose.tools as nt
20 import nose.tools as nt
21
21
22 # Our own imports
22 # Our own imports
23 from IPython.kernel.launcher import swallow_argv
23 from jupyter_client.launcher import swallow_argv
24
24
25 #-----------------------------------------------------------------------------
25 #-----------------------------------------------------------------------------
26 # Classes and functions
26 # Classes and functions
@@ -8,8 +8,8 b' from IPython.testing import decorators as dec'
8
8
9 from IPython.config.loader import Config
9 from IPython.config.loader import Config
10 from IPython.utils.localinterfaces import localhost
10 from IPython.utils.localinterfaces import localhost
11 from IPython.kernel import KernelManager
11 from jupyter_client import KernelManager
12 from IPython.kernel.multikernelmanager import MultiKernelManager
12 from jupyter_client.multikernelmanager import MultiKernelManager
13
13
14 class TestKernelManager(TestCase):
14 class TestKernelManager(TestCase):
15
15
@@ -1,4 +1,4 b''
1 """Test the IPython.kernel public API
1 """Test the jupyter_client public API
2
2
3 Authors
3 Authors
4 -------
4 -------
@@ -14,7 +14,7 b' Authors'
14
14
15 import nose.tools as nt
15 import nose.tools as nt
16
16
17 from IPython.kernel import launcher, connect
17 from jupyter_client import launcher, connect
18 from IPython import kernel
18 from IPython import kernel
19
19
20 #-----------------------------------------------------------------------------
20 #-----------------------------------------------------------------------------
@@ -13,7 +13,7 b' import zmq'
13 from zmq.tests import BaseZMQTestCase
13 from zmq.tests import BaseZMQTestCase
14 from zmq.eventloop.zmqstream import ZMQStream
14 from zmq.eventloop.zmqstream import ZMQStream
15
15
16 from IPython.kernel.zmq import session as ss
16 from jupyter_client import session as ss
17
17
18 from IPython.testing.decorators import skipif, module_not_available
18 from IPython.testing.decorators import skipif, module_not_available
19 from IPython.utils.py3compat import string_types
19 from IPython.utils.py3compat import string_types
@@ -14,9 +14,9 b' from zmq.eventloop import ioloop, zmqstream'
14
14
15 # Local imports
15 # Local imports
16 from IPython.utils.traitlets import Type, Instance
16 from IPython.utils.traitlets import Type, Instance
17 from IPython.kernel.channels import HBChannel
17 from jupyter_client.channels import HBChannel
18 from IPython.kernel import KernelClient
18 from jupyter_client import KernelClient
19 from IPython.kernel.channels import HBChannel
19 from jupyter_client.channels import HBChannel
20
20
21 class ThreadedZMQSocketChannel(object):
21 class ThreadedZMQSocketChannel(object):
22 """A ZMQ socket invoking a callback in the ioloop"""
22 """A ZMQ socket invoking a callback in the ioloop"""
General Comments 0
You need to be logged in to leave comments. Login now