##// END OF EJS Templates
Merge pull request #11852 from danielballan/formatter-usage...
Merge pull request #11852 from danielballan/formatter-usage Fix example usage of BaseFormatter.for_type_by_name.

File last commit:

r23398:f33ca742
r25166:4842416d merge
Show More
__init__.py
35 lines | 1.2 KiB | text/x-python | PythonLexer
Min RK
shims for jupyter_client
r20952 """
Min RK
finish kernel shims
r20956 Shim to maintain backwards compatibility with old IPython.kernel imports.
"""
Min RK
shims for jupyter_client
r20952 # Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
Min RK
add ShimWarning for shimmed imports...
r21515 from IPython.utils.shimmodule import ShimModule, ShimWarning
Min RK
shims for jupyter_client
r20952
Matthias Bussonnier
Update shim warnings to include IPython version....
r23398 warn("The `IPython.kernel` package has been deprecated since IPython 4.0."
Min RK
add ShimWarning for shimmed imports...
r21515 "You should import from ipykernel or jupyter_client instead.", ShimWarning)
Min RK
shims for jupyter_client
r20952
Min RK
remove ipython_kernel.zmq sub-pkg
r20957 # zmq subdir is gone
Min RK
add import hook for shim packages...
r20990 sys.modules['IPython.kernel.zmq.session'] = ShimModule(
src='IPython.kernel.zmq.session', mirror='jupyter_client.session')
sys.modules['IPython.kernel.zmq'] = ShimModule(
Min RK
ipython_kernel is now ipykernel
r21337 src='IPython.kernel.zmq', mirror='ipykernel')
Min RK
shims for jupyter_client
r20952
Min RK
kernel.resources isn't a package
r20958 for pkg in ('comm', 'inprocess'):
Min RK
add import hook for shim packages...
r20990 src = 'IPython.kernel.%s' % pkg
Min RK
ipython_kernel is now ipykernel
r21337 sys.modules[src] = ShimModule(src=src, mirror='ipykernel.%s' % pkg)
Min RK
remove ipython_kernel.zmq sub-pkg
r20957
Min RK
finish kernel shims
r20956 for pkg in ('ioloop', 'blocking'):
Min RK
add import hook for shim packages...
r20990 src = 'IPython.kernel.%s' % pkg
sys.modules[src] = ShimModule(src=src, mirror='jupyter_client.%s' % pkg)
Min RK
shims for jupyter_client
r20952
Min RK
finish kernel shims
r20956 # required for `from IPython.kernel import PKG`
Min RK
ipython_kernel is now ipykernel
r21337 from ipykernel import comm, inprocess
Min RK
finish kernel shims
r20956 from jupyter_client import ioloop, blocking
# public API
Min RK
ipython_kernel is now ipykernel
r21337 from ipykernel.connect import *
Min RK
finish kernel shims
r20956 from jupyter_client import *