##// END OF EJS Templates
Merge pull request #8213 from minrk/disable-install...
Merge pull request #8213 from minrk/disable-install disable install from master

File last commit:

r20951:706daf38
r21037:118e9403 merge
Show More
client.py
38 lines | 1.2 KiB | text/x-python | PythonLexer
MinRK
split KernelManager into KernelManager + KernelClient
r10285 """Implements a fully blocking kernel client.
Useful for test suites and blocking terminal interfaces.
"""
Thomas Kluyver
Move kernel_info for adaptation onto KernelClient
r19216 # Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
MinRK
split KernelManager into KernelManager + KernelClient
r10285
Thomas Kluyver
Move kernel_info for adaptation onto KernelClient
r19216 try:
from queue import Empty # Python 3
except ImportError:
from Queue import Empty # Python 2
MinRK
split KernelManager into KernelManager + KernelClient
r10285
from IPython.utils.traitlets import Type
Min RK
s/IPython.kernel/jupyter_client in jupyter_client
r20951 from jupyter_client.channels import HBChannel
from jupyter_client.client import KernelClient
Thomas Kluyver
Simplify HBChannel inheritance
r19227 from .channels import ZMQSocketChannel
MinRK
split KernelManager into KernelManager + KernelClient
r10285
class BlockingKernelClient(KernelClient):
Thomas Kluyver
Move kernel_info for adaptation onto KernelClient
r19216 def wait_for_ready(self):
# Wait for kernel info reply on shell channel
while True:
msg = self.shell_channel.get_msg(block=True)
if msg['msg_type'] == 'kernel_info_reply':
self._handle_kernel_info_reply(msg)
break
# Flush IOPub channel
while True:
try:
msg = self.iopub_channel.get_msg(block=True, timeout=0.2)
except Empty:
break
MinRK
split KernelManager into KernelManager + KernelClient
r10285
# The classes to use for the various channels
Thomas Kluyver
Move ZMQ socket creation out of channels
r19217 shell_channel_class = Type(ZMQSocketChannel)
iopub_channel_class = Type(ZMQSocketChannel)
stdin_channel_class = Type(ZMQSocketChannel)
Thomas Kluyver
Simplify HBChannel inheritance
r19227 hb_channel_class = Type(HBChannel)