##// END OF EJS Templates
Update shim warnings to include IPython version....
Matthias Bussonnier -
Show More
@@ -1,19 +1,19 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.config imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.config` package has been deprecated. "
12 warn("The `IPython.config` package has been deprecated since IPython 4.0. "
13 13 "You should import from traitlets.config instead.", ShimWarning)
14 14
15 15
16 16 # Unconditionally insert the shim into sys.modules so that further import calls
17 17 # trigger the custom attribute access above
18 18
19 19 sys.modules['IPython.config'] = ShimModule(src='IPython.config', mirror='traitlets.config')
@@ -1,29 +1,29 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old frontend imports.
3 3
4 4 We have moved all contents of the old `frontend` subpackage into top-level
5 5 subpackages (`html`, `qt` and `terminal`), and flattened the notebook into
6 6 just `IPython.html`, formerly `IPython.frontend.html.notebook`.
7 7
8 8 This will let code that was making `from IPython.frontend...` calls continue
9 9 working, though a warning will be printed.
10 10 """
11 11
12 12 # Copyright (c) IPython Development Team.
13 13 # Distributed under the terms of the Modified BSD License.
14 14
15 15 import sys
16 16 from warnings import warn
17 17
18 18 from IPython.utils.shimmodule import ShimModule, ShimWarning
19 19
20 warn("The top-level `frontend` package has been deprecated. "
20 warn("The top-level `frontend` package has been deprecated since IPython 1.0. "
21 21 "All its subpackages have been moved to the top `IPython` level.", ShimWarning)
22 22
23 23 # Unconditionally insert the shim into sys.modules so that further import calls
24 24 # trigger the custom attribute access above
25 25
26 26 sys.modules['IPython.frontend.html.notebook'] = ShimModule(
27 27 src='IPython.frontend.html.notebook', mirror='IPython.html')
28 28 sys.modules['IPython.frontend'] = ShimModule(
29 29 src='IPython.frontend', mirror='IPython')
@@ -1,28 +1,28 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.html imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.html` package has been deprecated. "
12 warn("The `IPython.html` package has been deprecated since IPython 4.0. "
13 13 "You should import from `notebook` instead. "
14 14 "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
15 15
16 16 _widgets = sys.modules['IPython.html.widgets'] = ShimModule(
17 17 src='IPython.html.widgets', mirror='ipywidgets')
18 18
19 19 _html = ShimModule(
20 20 src='IPython.html', mirror='notebook')
21 21
22 22 # hook up widgets
23 23 _html.widgets = _widgets
24 24 sys.modules['IPython.html'] = _html
25 25
26 26 if __name__ == '__main__':
27 27 from notebook import notebookapp as app
28 28 app.launch_new_instance()
@@ -1,35 +1,35 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.kernel imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.kernel` package has been deprecated. "
12 warn("The `IPython.kernel` package has been deprecated since IPython 4.0."
13 13 "You should import from ipykernel or jupyter_client instead.", ShimWarning)
14 14
15 15
16 16 # zmq subdir is gone
17 17 sys.modules['IPython.kernel.zmq.session'] = ShimModule(
18 18 src='IPython.kernel.zmq.session', mirror='jupyter_client.session')
19 19 sys.modules['IPython.kernel.zmq'] = ShimModule(
20 20 src='IPython.kernel.zmq', mirror='ipykernel')
21 21
22 22 for pkg in ('comm', 'inprocess'):
23 23 src = 'IPython.kernel.%s' % pkg
24 24 sys.modules[src] = ShimModule(src=src, mirror='ipykernel.%s' % pkg)
25 25
26 26 for pkg in ('ioloop', 'blocking'):
27 27 src = 'IPython.kernel.%s' % pkg
28 28 sys.modules[src] = ShimModule(src=src, mirror='jupyter_client.%s' % pkg)
29 29
30 30 # required for `from IPython.kernel import PKG`
31 31 from ipykernel import comm, inprocess
32 32 from jupyter_client import ioloop, blocking
33 33 # public API
34 34 from ipykernel.connect import *
35 35 from jupyter_client import *
@@ -1,19 +1,19 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.nbconvert imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.nbconvert` package has been deprecated. "
12 warn("The `IPython.nbconvert` package has been deprecated since IPython 4.0. "
13 13 "You should import from nbconvert instead.", ShimWarning)
14 14
15 15 # Unconditionally insert the shim into sys.modules so that further import calls
16 16 # trigger the custom attribute access above
17 17
18 18 sys.modules['IPython.nbconvert'] = ShimModule(
19 19 src='IPython.nbconvert', mirror='nbconvert')
@@ -1,19 +1,19 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.nbformat imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.nbformat` package has been deprecated. "
12 warn("The `IPython.nbformat` package has been deprecated since IPython 4.0. "
13 13 "You should import from nbformat instead.", ShimWarning)
14 14
15 15 # Unconditionally insert the shim into sys.modules so that further import calls
16 16 # trigger the custom attribute access above
17 17
18 18 sys.modules['IPython.nbformat'] = ShimModule(
19 19 src='IPython.nbformat', mirror='nbformat')
@@ -1,20 +1,20 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.parallel imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.parallel` package has been deprecated. "
12 warn("The `IPython.parallel` package has been deprecated since IPython 4.0. "
13 13 "You should import from ipyparallel instead.", ShimWarning)
14 14
15 15 # Unconditionally insert the shim into sys.modules so that further import calls
16 16 # trigger the custom attribute access above
17 17
18 18 sys.modules['IPython.parallel'] = ShimModule(
19 19 src='IPython.parallel', mirror='ipyparallel')
20 20
@@ -1,24 +1,24 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.qt imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.qt` package has been deprecated. "
12 warn("The `IPython.qt` package has been deprecated since IPython 4.0. "
13 13 "You should import from qtconsole instead.", ShimWarning)
14 14
15 15 # Unconditionally insert the shim into sys.modules so that further import calls
16 16 # trigger the custom attribute access above
17 17
18 18 _console = sys.modules['IPython.qt.console'] = ShimModule(
19 19 src='IPython.qt.console', mirror='qtconsole')
20 20
21 21 _qt = ShimModule(src='IPython.qt', mirror='qtconsole')
22 22
23 23 _qt.console = _console
24 24 sys.modules['IPython.qt'] = _qt
@@ -1,19 +1,19 b''
1 1 """
2 2 Shim to maintain backwards compatibility with old IPython.terminal.console imports.
3 3 """
4 4 # Copyright (c) IPython Development Team.
5 5 # Distributed under the terms of the Modified BSD License.
6 6
7 7 import sys
8 8 from warnings import warn
9 9
10 10 from IPython.utils.shimmodule import ShimModule, ShimWarning
11 11
12 warn("The `IPython.terminal.console` package has been deprecated. "
12 warn("The `IPython.terminal.console` package has been deprecated since IPython 4.0. "
13 13 "You should import from jupyter_console instead.", ShimWarning)
14 14
15 15 # Unconditionally insert the shim into sys.modules so that further import calls
16 16 # trigger the custom attribute access above
17 17
18 18 sys.modules['IPython.terminal.console'] = ShimModule(
19 19 src='IPython.terminal.console', mirror='jupyter_console')
General Comments 0
You need to be logged in to leave comments. Login now