html.py
28 lines
| 839 B
| text/x-python
|
PythonLexer
/ IPython / html.py
Min RK
|
r21209 | """ | ||
Shim to maintain backwards compatibility with old IPython.html imports. | ||||
""" | ||||
# Copyright (c) IPython Development Team. | ||||
# Distributed under the terms of the Modified BSD License. | ||||
import sys | ||||
from warnings import warn | ||||
Min RK
|
r21515 | from IPython.utils.shimmodule import ShimModule, ShimWarning | ||
Matthias Bussonnier
|
r23398 | warn("The `IPython.html` package has been deprecated since IPython 4.0. " | ||
Thomas Kluyver
|
r21360 | "You should import from `notebook` instead. " | ||
Min RK
|
r21515 | "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning) | ||
Min RK
|
r21209 | |||
Min RK
|
r21312 | _widgets = sys.modules['IPython.html.widgets'] = ShimModule( | ||
Thomas Kluyver
|
r21361 | src='IPython.html.widgets', mirror='ipywidgets') | ||
Min RK
|
r21302 | |||
Min RK
|
r21312 | _html = ShimModule( | ||
Thomas Kluyver
|
r21360 | src='IPython.html', mirror='notebook') | ||
Min RK
|
r21308 | |||
Min RK
|
r21312 | # hook up widgets | ||
_html.widgets = _widgets | ||||
sys.modules['IPython.html'] = _html | ||||
Min RK
|
r21211 | if __name__ == '__main__': | ||
Thomas Kluyver
|
r21360 | from notebook import notebookapp as app | ||
Min RK
|
r21211 | app.launch_new_instance() | ||