File: __init__.py

package info (click to toggle)
ipython 5.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,428 kB
  • ctags: 4,941
  • sloc: python: 33,657; makefile: 170; sh: 139
file content (35 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Shim to maintain backwards compatibility with old IPython.kernel imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

import sys
from warnings import warn

from IPython.utils.shimmodule import ShimModule, ShimWarning

warn("The `IPython.kernel` package has been deprecated. "
     "You should import from ipykernel or jupyter_client instead.", ShimWarning)


# zmq subdir is gone
sys.modules['IPython.kernel.zmq.session'] = ShimModule(
    src='IPython.kernel.zmq.session', mirror='jupyter_client.session')
sys.modules['IPython.kernel.zmq'] = ShimModule(
    src='IPython.kernel.zmq', mirror='ipykernel')

for pkg in ('comm', 'inprocess'):
    src = 'IPython.kernel.%s' % pkg
    sys.modules[src] = ShimModule(src=src, mirror='ipykernel.%s' % pkg)

for pkg in ('ioloop', 'blocking'):
    src = 'IPython.kernel.%s' % pkg
    sys.modules[src] = ShimModule(src=src, mirror='jupyter_client.%s' % pkg)

# required for `from IPython.kernel import PKG`
from ipykernel import comm, inprocess
from jupyter_client import ioloop, blocking
# public API
from ipykernel.connect import *
from jupyter_client import *