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