From 244bf60303d0c65d906e07488ea570181ff1f35b 2015-04-09 06:04:21 From: Min RK <benjaminrk@gmail.com> Date: 2015-04-09 06:04:21 Subject: [PATCH] jupyter_notebook imports --- diff --git a/jupyter_notebook/__main__.py b/jupyter_notebook/__main__.py index 1898a90..a66a021 100644 --- a/jupyter_notebook/__main__.py +++ b/jupyter_notebook/__main__.py @@ -1,3 +1,3 @@ if __name__ == '__main__': - from IPython.html import notebookapp as app + from jupyter_notebook import notebookapp as app app.launch_new_instance() diff --git a/jupyter_notebook/base/handlers.py b/jupyter_notebook/base/handlers.py index 202bf36..f77fde4 100644 --- a/jupyter_notebook/base/handlers.py +++ b/jupyter_notebook/base/handlers.py @@ -29,9 +29,9 @@ from IPython.utils.sysinfo import get_sys_info from IPython.config import Application from IPython.utils.path import filefind from IPython.utils.py3compat import string_types -from IPython.html.utils import is_hidden, url_path_join, url_escape +from jupyter_notebook.utils import is_hidden, url_path_join, url_escape -from IPython.html.services.security import csp_report_uri +from jupyter_notebook.services.security import csp_report_uri #----------------------------------------------------------------------------- # Top-level handlers diff --git a/jupyter_notebook/base/zmqhandlers.py b/jupyter_notebook/base/zmqhandlers.py index 122af3b..e8405ca 100644 --- a/jupyter_notebook/base/zmqhandlers.py +++ b/jupyter_notebook/base/zmqhandlers.py @@ -90,7 +90,7 @@ WS_PING_INTERVAL = 30000 if os.environ.get('IPYTHON_ALLOW_DRAFT_WEBSOCKETS_FOR_PHANTOMJS', False): warnings.warn("""Allowing draft76 websocket connections! This should only be done for testing with phantomjs!""") - from IPython.html import allow76 + from jupyter_notebook import allow76 WebSocketHandler = allow76.AllowDraftWebSocketHandler # draft 76 doesn't support ping WS_PING_INTERVAL = 0 diff --git a/jupyter_notebook/files/handlers.py b/jupyter_notebook/files/handlers.py index 7727d08..6246442 100644 --- a/jupyter_notebook/files/handlers.py +++ b/jupyter_notebook/files/handlers.py @@ -10,7 +10,7 @@ import base64 from tornado import web -from IPython.html.base.handlers import IPythonHandler +from jupyter_notebook.base.handlers import IPythonHandler class FilesHandler(IPythonHandler): """serve files via ContentsManager""" diff --git a/jupyter_notebook/nbconvert/tests/test_nbconvert_handlers.py b/jupyter_notebook/nbconvert/tests/test_nbconvert_handlers.py index 88ff3a7..352719f 100644 --- a/jupyter_notebook/nbconvert/tests/test_nbconvert_handlers.py +++ b/jupyter_notebook/nbconvert/tests/test_nbconvert_handlers.py @@ -8,8 +8,8 @@ import shutil import requests -from IPython.html.utils import url_path_join -from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error +from jupyter_notebook.utils import url_path_join +from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error from IPython.nbformat import write from IPython.nbformat.v4 import ( new_notebook, new_markdown_cell, new_code_cell, new_output, diff --git a/jupyter_notebook/notebookapp.py b/jupyter_notebook/notebookapp.py index 1b3ad7a..621739e 100644 --- a/jupyter_notebook/notebookapp.py +++ b/jupyter_notebook/notebookapp.py @@ -49,7 +49,7 @@ from tornado import httpserver from tornado import web from tornado.log import LogFormatter, app_log, access_log, gen_log -from IPython.html import ( +from jupyter_notebook import ( DEFAULT_STATIC_FILES_PATH, DEFAULT_TEMPLATE_PATH_LIST, ) @@ -116,7 +116,7 @@ def random_ports(port, n): def load_handlers(name): """Load the (URL pattern, handler) tuples for each component.""" - name = 'IPython.html.' + name + name = 'jupyter_notebook.' + name mod = __import__(name, fromlist=['default_handlers']) return mod.default_handlers @@ -576,7 +576,7 @@ class NotebookApp(BaseIPythonApplication): extra_template_paths = List(Unicode, config=True, help="""Extra paths to search for serving jinja templates. - Can be used to override templates from IPython.html.templates.""" + Can be used to override templates from jupyter_notebook.templates.""" ) def _extra_template_paths_default(self): return [] diff --git a/jupyter_notebook/services/config/tests/test_config_api.py b/jupyter_notebook/services/config/tests/test_config_api.py index 463fc4e..38f85a9 100644 --- a/jupyter_notebook/services/config/tests/test_config_api.py +++ b/jupyter_notebook/services/config/tests/test_config_api.py @@ -5,8 +5,8 @@ import json import requests -from IPython.html.utils import url_path_join -from IPython.html.tests.launchnotebook import NotebookTestBase +from jupyter_notebook.utils import url_path_join +from jupyter_notebook.tests.launchnotebook import NotebookTestBase class ConfigAPI(object): diff --git a/jupyter_notebook/services/contents/fileio.py b/jupyter_notebook/services/contents/fileio.py index 7fa09c2..217f8f2 100644 --- a/jupyter_notebook/services/contents/fileio.py +++ b/jupyter_notebook/services/contents/fileio.py @@ -15,7 +15,7 @@ import tempfile from tornado.web import HTTPError -from IPython.html.utils import ( +from jupyter_notebook.utils import ( to_api_path, to_os_path, ) diff --git a/jupyter_notebook/services/contents/filemanager.py b/jupyter_notebook/services/contents/filemanager.py index 01ce07b..44c42a9 100644 --- a/jupyter_notebook/services/contents/filemanager.py +++ b/jupyter_notebook/services/contents/filemanager.py @@ -20,7 +20,7 @@ from IPython.utils.importstring import import_item from IPython.utils.traitlets import Any, Unicode, Bool, TraitError from IPython.utils.py3compat import getcwd, string_types from IPython.utils import tz -from IPython.html.utils import ( +from jupyter_notebook.utils import ( is_hidden, to_api_path, ) diff --git a/jupyter_notebook/services/contents/handlers.py b/jupyter_notebook/services/contents/handlers.py index 7d3f67d..7baf7bb 100644 --- a/jupyter_notebook/services/contents/handlers.py +++ b/jupyter_notebook/services/contents/handlers.py @@ -7,10 +7,10 @@ import json from tornado import gen, web -from IPython.html.utils import url_path_join, url_escape +from jupyter_notebook.utils import url_path_join, url_escape from jupyter_client.jsonutil import date_default -from IPython.html.base.handlers import ( +from jupyter_notebook.base.handlers import ( IPythonHandler, json_errors, path_regex, ) diff --git a/jupyter_notebook/services/contents/tests/test_contents_api.py b/jupyter_notebook/services/contents/tests/test_contents_api.py index c5ac049..5743fa4 100644 --- a/jupyter_notebook/services/contents/tests/test_contents_api.py +++ b/jupyter_notebook/services/contents/tests/test_contents_api.py @@ -16,8 +16,8 @@ import requests from ..filecheckpoints import GenericFileCheckpoints from IPython.config import Config -from IPython.html.utils import url_path_join, url_escape, to_os_path -from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error +from jupyter_notebook.utils import url_path_join, url_escape, to_os_path +from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error from IPython.nbformat import read, write, from_dict from IPython.nbformat.v4 import ( new_notebook, new_markdown_cell, diff --git a/jupyter_notebook/services/kernels/handlers.py b/jupyter_notebook/services/kernels/handlers.py index 15b8c3e..6b3a10b 100644 --- a/jupyter_notebook/services/kernels/handlers.py +++ b/jupyter_notebook/services/kernels/handlers.py @@ -11,7 +11,7 @@ from tornado.ioloop import IOLoop from jupyter_client.jsonutil import date_default from IPython.utils.py3compat import cast_unicode -from IPython.html.utils import url_path_join, url_escape +from jupyter_notebook.utils import url_path_join, url_escape from ...base.handlers import IPythonHandler, json_errors from ...base.zmqhandlers import AuthenticatedZMQStreamHandler, deserialize_binary_message diff --git a/jupyter_notebook/services/kernels/kernelmanager.py b/jupyter_notebook/services/kernels/kernelmanager.py index b96370c..2ea2e82 100644 --- a/jupyter_notebook/services/kernels/kernelmanager.py +++ b/jupyter_notebook/services/kernels/kernelmanager.py @@ -14,7 +14,7 @@ from tornado import web from IPython.kernel.multikernelmanager import MultiKernelManager from IPython.utils.traitlets import List, Unicode, TraitError -from IPython.html.utils import to_os_path +from jupyter_notebook.utils import to_os_path from IPython.utils.py3compat import getcwd diff --git a/jupyter_notebook/services/kernels/tests/test_kernels_api.py b/jupyter_notebook/services/kernels/tests/test_kernels_api.py index 0ae75f2..87dfb1b 100644 --- a/jupyter_notebook/services/kernels/tests/test_kernels_api.py +++ b/jupyter_notebook/services/kernels/tests/test_kernels_api.py @@ -5,8 +5,8 @@ import requests from jupyter_client.kernelspec import NATIVE_KERNEL_NAME -from IPython.html.utils import url_path_join -from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error +from jupyter_notebook.utils import url_path_join +from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error class KernelAPI(object): """Wrapper for kernel REST API requests""" diff --git a/jupyter_notebook/services/kernelspecs/tests/test_kernelspecs_api.py b/jupyter_notebook/services/kernelspecs/tests/test_kernelspecs_api.py index 92fdff4..76efe02 100644 --- a/jupyter_notebook/services/kernelspecs/tests/test_kernelspecs_api.py +++ b/jupyter_notebook/services/kernelspecs/tests/test_kernelspecs_api.py @@ -12,8 +12,8 @@ pjoin = os.path.join import requests from IPython.kernel.kernelspec import NATIVE_KERNEL_NAME -from IPython.html.utils import url_path_join -from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error +from jupyter_notebook.utils import url_path_join +from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error # Copied from IPython.kernel.tests.test_kernelspec so updating that doesn't # break these tests diff --git a/jupyter_notebook/services/nbconvert/tests/test_nbconvert_api.py b/jupyter_notebook/services/nbconvert/tests/test_nbconvert_api.py index 291ec74..d902d66 100644 --- a/jupyter_notebook/services/nbconvert/tests/test_nbconvert_api.py +++ b/jupyter_notebook/services/nbconvert/tests/test_nbconvert_api.py @@ -1,7 +1,7 @@ import requests -from IPython.html.utils import url_path_join -from IPython.html.tests.launchnotebook import NotebookTestBase +from jupyter_notebook.utils import url_path_join +from jupyter_notebook.tests.launchnotebook import NotebookTestBase class NbconvertAPI(object): """Wrapper for nbconvert API calls.""" diff --git a/jupyter_notebook/services/sessions/handlers.py b/jupyter_notebook/services/sessions/handlers.py index d12a8b5..438f4d7 100644 --- a/jupyter_notebook/services/sessions/handlers.py +++ b/jupyter_notebook/services/sessions/handlers.py @@ -9,7 +9,7 @@ from tornado import web from ...base.handlers import IPythonHandler, json_errors from jupyter_client.jsonutil import date_default -from IPython.html.utils import url_path_join, url_escape +from jupyter_notebook.utils import url_path_join, url_escape from IPython.kernel.kernelspec import NoSuchKernel diff --git a/jupyter_notebook/services/sessions/sessionmanager.py b/jupyter_notebook/services/sessions/sessionmanager.py index 967c4b1..516a97d 100644 --- a/jupyter_notebook/services/sessions/sessionmanager.py +++ b/jupyter_notebook/services/sessions/sessionmanager.py @@ -15,8 +15,8 @@ from IPython.utils.traitlets import Instance class SessionManager(LoggingConfigurable): - kernel_manager = Instance('IPython.html.services.kernels.kernelmanager.MappingKernelManager') - contents_manager = Instance('IPython.html.services.contents.manager.ContentsManager') + kernel_manager = Instance('jupyter_notebook.services.kernels.kernelmanager.MappingKernelManager') + contents_manager = Instance('jupyter_notebook.services.contents.manager.ContentsManager') # Session database initialized below _cursor = None diff --git a/jupyter_notebook/services/sessions/tests/test_sessionmanager.py b/jupyter_notebook/services/sessions/tests/test_sessionmanager.py index 78036c9..f8e624b 100644 --- a/jupyter_notebook/services/sessions/tests/test_sessionmanager.py +++ b/jupyter_notebook/services/sessions/tests/test_sessionmanager.py @@ -5,8 +5,8 @@ from unittest import TestCase from tornado import web from ..sessionmanager import SessionManager -from IPython.html.services.kernels.kernelmanager import MappingKernelManager -from IPython.html.services.contents.manager import ContentsManager +from jupyter_notebook.services.kernels.kernelmanager import MappingKernelManager +from jupyter_notebook.services.contents.manager import ContentsManager class DummyKernel(object): def __init__(self, kernel_name='python'): diff --git a/jupyter_notebook/services/sessions/tests/test_sessions_api.py b/jupyter_notebook/services/sessions/tests/test_sessions_api.py index 78dcb5f..005e3ba 100644 --- a/jupyter_notebook/services/sessions/tests/test_sessions_api.py +++ b/jupyter_notebook/services/sessions/tests/test_sessions_api.py @@ -10,8 +10,8 @@ import time pjoin = os.path.join -from IPython.html.utils import url_path_join -from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error +from jupyter_notebook.utils import url_path_join +from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error from IPython.nbformat.v4 import new_notebook from IPython.nbformat import write diff --git a/jupyter_notebook/static/widgets/js/manager.js b/jupyter_notebook/static/widgets/js/manager.js index 4cf7a05..c81a474 100644 --- a/jupyter_notebook/static/widgets/js/manager.js +++ b/jupyter_notebook/static/widgets/js/manager.js @@ -299,7 +299,7 @@ define([ * JS: * IPython.notebook.kernel.widget_manager.create_model({ * model_name: 'WidgetModel', - * widget_class: 'IPython.html.widgets.widget_int.IntSlider'}) + * widget_class: 'jupyter_notebook.widgets.widget_int.IntSlider'}) * .then(function(model) { console.log('Create success!', model); }, * $.proxy(console.error, console)); * diff --git a/jupyter_notebook/terminal/__init__.py b/jupyter_notebook/terminal/__init__.py index 5b212e7..2db065b 100644 --- a/jupyter_notebook/terminal/__init__.py +++ b/jupyter_notebook/terminal/__init__.py @@ -8,7 +8,7 @@ if not check_version(terminado.__version__, '0.3.3'): from terminado import NamedTermManager from tornado.log import app_log -from IPython.html.utils import url_path_join as ujoin +from jupyter_notebook.utils import url_path_join as ujoin from .handlers import TerminalHandler, TermSocket from . import api_handlers diff --git a/jupyter_notebook/tests/test_files.py b/jupyter_notebook/tests/test_files.py index 51a8d03..6c53fcf 100644 --- a/jupyter_notebook/tests/test_files.py +++ b/jupyter_notebook/tests/test_files.py @@ -15,7 +15,7 @@ from IPython.nbformat.v4 import (new_notebook, new_markdown_cell, new_code_cell, new_output) -from IPython.html.utils import url_path_join +from jupyter_notebook.utils import url_path_join from .launchnotebook import NotebookTestBase from IPython.utils import py3compat diff --git a/jupyter_notebook/tests/test_nbextensions.py b/jupyter_notebook/tests/test_nbextensions.py index 4c5a646..2d83bad 100644 --- a/jupyter_notebook/tests/test_nbextensions.py +++ b/jupyter_notebook/tests/test_nbextensions.py @@ -22,8 +22,8 @@ except ImportError: import IPython.testing.decorators as dec from IPython.utils import py3compat from IPython.utils.tempdir import TemporaryDirectory -from IPython.html import nbextensions -from IPython.html.nbextensions import install_nbextension, check_nbextension +from jupyter_notebook import nbextensions +from jupyter_notebook.nbextensions import install_nbextension, check_nbextension def touch(file, mtime=None): diff --git a/jupyter_notebook/tests/test_notebookapp.py b/jupyter_notebook/tests/test_notebookapp.py index 8546589..8cee327 100644 --- a/jupyter_notebook/tests/test_notebookapp.py +++ b/jupyter_notebook/tests/test_notebookapp.py @@ -11,13 +11,13 @@ from traitlets.tests.utils import check_help_all_output from IPython.utils.tempdir import TemporaryDirectory from IPython.utils.traitlets import TraitError -from IPython.html import notebookapp +from jupyter_notebook import notebookapp NotebookApp = notebookapp.NotebookApp def test_help_output(): """ipython notebook --help-all works""" - check_help_all_output('IPython.html') + check_help_all_output('jupyter_notebook') def test_server_info_file(): nbapp = NotebookApp(profile='nbserver_file_test', log=logging.getLogger()) diff --git a/jupyter_notebook/tests/test_paths.py b/jupyter_notebook/tests/test_paths.py index 01b24fe..b45b5ad 100644 --- a/jupyter_notebook/tests/test_paths.py +++ b/jupyter_notebook/tests/test_paths.py @@ -2,7 +2,7 @@ import re import nose.tools as nt -from IPython.html.base.handlers import path_regex +from jupyter_notebook.base.handlers import path_regex try: # py3 assert_regex = nt.assert_regex diff --git a/jupyter_notebook/tests/test_utils.py b/jupyter_notebook/tests/test_utils.py index eba3f75..9cc7d45 100644 --- a/jupyter_notebook/tests/test_utils.py +++ b/jupyter_notebook/tests/test_utils.py @@ -8,14 +8,14 @@ import os import nose.tools as nt from traitlets.tests.utils import check_help_all_output -from IPython.html.utils import url_escape, url_unescape, is_hidden +from jupyter_notebook.utils import url_escape, url_unescape, is_hidden from IPython.utils.tempdir import TemporaryDirectory def test_help_output(): """jupyter notebook --help-all works""" # FIXME: will be jupyter_notebook - check_help_all_output('IPython.html') + check_help_all_output('jupyter_notebook') def test_url_escape(): diff --git a/jupyter_notebook/tests/widgets/manager.js b/jupyter_notebook/tests/widgets/manager.js index 296e52d..b81e70f 100644 --- a/jupyter_notebook/tests/widgets/manager.js +++ b/jupyter_notebook/tests/widgets/manager.js @@ -18,7 +18,7 @@ casper.notebook_test(function () { this.evaluate(function() { IPython.notebook.kernel.widget_manager.create_model({ model_name: 'WidgetModel', - widget_class: 'IPython.html.widgets.widget_int.IntSlider'}) + widget_class: 'jupyter_notebook.widgets.widget_int.IntSlider'}) .then(function(model) { console.log('Create success!', model); window.slider_id = model.id; @@ -34,7 +34,7 @@ casper.notebook_test(function () { }); index = this.append_cell( - 'from IPython.html.widgets import Widget\n' + + 'from jupyter_notebook.widgets import Widget\n' + 'widget = list(Widget.widgets.values())[0]\n' + 'print(widget.model_id)'); this.execute_cell_then(index, function(index) { @@ -45,7 +45,7 @@ casper.notebook_test(function () { // Widget persistence tests. index = this.append_cell( - 'from IPython.html.widgets import HTML\n' + + 'from jupyter_notebook.widgets import HTML\n' + 'from IPython.display import display\n' + 'display(HTML(value="<div id=\'hello\'></div>"))'); this.execute_cell_then(index, function() {}); diff --git a/jupyter_notebook/tests/widgets/widget.js b/jupyter_notebook/tests/widgets/widget.js index 372e293..5b09298 100644 --- a/jupyter_notebook/tests/widgets/widget.js +++ b/jupyter_notebook/tests/widgets/widget.js @@ -40,7 +40,7 @@ casper.notebook_test(function () { var index; index = this.append_cell( - ['from IPython.html import widgets', + ['from jupyter_notebook import widgets', 'from IPython.display import display, clear_output', 'print("Success")'].join('\n')); this.execute_cell_then(index); @@ -184,7 +184,7 @@ casper.notebook_test(function () { var testwidget = {}; this.append_cell_execute_then([ - 'from IPython.html import widgets', + 'from jupyter_notebook import widgets', 'from IPython.utils.traitlets import Unicode, Instance, List', 'from IPython.display import display', 'from array import array', diff --git a/jupyter_notebook/tests/widgets/widget_bool.js b/jupyter_notebook/tests/widgets/widget_bool.js index 556031c..3f0ed18 100644 --- a/jupyter_notebook/tests/widgets/widget_bool.js +++ b/jupyter_notebook/tests/widgets/widget_bool.js @@ -4,7 +4,7 @@ casper.notebook_test(function () { // Create a checkbox and togglebutton. var bool_index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'bool_widgets = [widgets.Checkbox(description="Title", value=True),\n' + ' widgets.ToggleButton(description="Title", value=True)]\n' + diff --git a/jupyter_notebook/tests/widgets/widget_box.js b/jupyter_notebook/tests/widgets/widget_box.js index 617423d..f0d7e5b 100644 --- a/jupyter_notebook/tests/widgets/widget_box.js +++ b/jupyter_notebook/tests/widgets/widget_box.js @@ -3,7 +3,7 @@ casper.notebook_test(function () { // Create a box widget. var container_index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'container = widgets.Box()\n' + 'button = widgets.Button()\n'+ diff --git a/jupyter_notebook/tests/widgets/widget_button.js b/jupyter_notebook/tests/widgets/widget_button.js index 97ea5ee..cdc1255 100644 --- a/jupyter_notebook/tests/widgets/widget_button.js +++ b/jupyter_notebook/tests/widgets/widget_button.js @@ -1,7 +1,7 @@ // Test widget button class casper.notebook_test(function () { var button_index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'button = widgets.Button(description="Title")\n' + 'display(button)\n' + diff --git a/jupyter_notebook/tests/widgets/widget_float.js b/jupyter_notebook/tests/widgets/widget_float.js index d253a80..08cb212 100644 --- a/jupyter_notebook/tests/widgets/widget_float.js +++ b/jupyter_notebook/tests/widgets/widget_float.js @@ -3,7 +3,7 @@ casper.notebook_test(function () { var float_text = {}; float_text.query = '.widget-area .widget-subarea .my-second-float-text input'; float_text.index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'float_widget = widgets.FloatText()\n' + 'display(float_widget)\n' + diff --git a/jupyter_notebook/tests/widgets/widget_image.js b/jupyter_notebook/tests/widgets/widget_image.js index 0a79910..fc7c08e 100644 --- a/jupyter_notebook/tests/widgets/widget_image.js +++ b/jupyter_notebook/tests/widgets/widget_image.js @@ -2,7 +2,7 @@ casper.notebook_test(function () { "use strict"; var index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'print("Success")'); this.execute_cell_then(index); diff --git a/jupyter_notebook/tests/widgets/widget_int.js b/jupyter_notebook/tests/widgets/widget_int.js index 8ca6ca8..79cad87 100644 --- a/jupyter_notebook/tests/widgets/widget_int.js +++ b/jupyter_notebook/tests/widgets/widget_int.js @@ -3,7 +3,7 @@ casper.notebook_test(function () { var int_text = {}; int_text.query = '.widget-area .widget-subarea .my-second-int-text input'; int_text.index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'int_widget = widgets.IntText()\n' + 'display(int_widget)\n' + diff --git a/jupyter_notebook/tests/widgets/widget_selection.js b/jupyter_notebook/tests/widgets/widget_selection.js index a3c5bcf..665ba8e 100644 --- a/jupyter_notebook/tests/widgets/widget_selection.js +++ b/jupyter_notebook/tests/widgets/widget_selection.js @@ -1,7 +1,7 @@ // Test selection class casper.notebook_test(function () { index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'print("Success")'); this.execute_cell_then(index); diff --git a/jupyter_notebook/tests/widgets/widget_selectioncontainer.js b/jupyter_notebook/tests/widgets/widget_selectioncontainer.js index d8680ad..72d2d04 100644 --- a/jupyter_notebook/tests/widgets/widget_selectioncontainer.js +++ b/jupyter_notebook/tests/widgets/widget_selectioncontainer.js @@ -1,7 +1,7 @@ // Test multicontainer class casper.notebook_test(function () { index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'print("Success")'); this.execute_cell_then(index); diff --git a/jupyter_notebook/tests/widgets/widget_string.js b/jupyter_notebook/tests/widgets/widget_string.js index c01afb7..4f3985d 100644 --- a/jupyter_notebook/tests/widgets/widget_string.js +++ b/jupyter_notebook/tests/widgets/widget_string.js @@ -1,7 +1,7 @@ // Test widget string class casper.notebook_test(function () { var string_index = this.append_cell( - 'from IPython.html import widgets\n' + + 'from jupyter_notebook import widgets\n' + 'from IPython.display import display, clear_output\n' + 'string_widget = [widgets.Text(value = "xyz", placeholder = "abc"),\n' + ' widgets.Textarea(value = "xyz", placeholder = "def"),\n' + diff --git a/jupyter_notebook/tree/tests/test_tree_handler.py b/jupyter_notebook/tree/tests/test_tree_handler.py index 62cef5c..8c771bb 100644 --- a/jupyter_notebook/tree/tests/test_tree_handler.py +++ b/jupyter_notebook/tree/tests/test_tree_handler.py @@ -1,13 +1,13 @@ """Test the /tree handlers""" import os import io -from IPython.html.utils import url_path_join +from jupyter_notebook.utils import url_path_join from IPython.nbformat import write from IPython.nbformat.v4 import new_notebook import requests -from IPython.html.tests.launchnotebook import NotebookTestBase +from jupyter_notebook.tests.launchnotebook import NotebookTestBase class TreeTest(NotebookTestBase): def setUp(self): diff --git a/jupyter_notebook/widgets/__init__.py b/jupyter_notebook/widgets/__init__.py index ab5b2f8..3219b2a 100644 --- a/jupyter_notebook/widgets/__init__.py +++ b/jupyter_notebook/widgets/__init__.py @@ -31,10 +31,10 @@ from .widget_string import HTMLWidget, LatexWidget, TextWidget, TextareaWidget # To ignore this warning, do: # # from warnings import filterwarnings -# filterwarnings('ignore', module='IPython.html.widgets') +# filterwarnings('ignore', module='jupyter_notebook.widgets') from warnings import warn_explicit __warningregistry__ = {} warn_explicit("IPython widgets are experimental and may change in the future.", - FutureWarning, '', 0, module = 'IPython.html.widgets', + FutureWarning, '', 0, module = 'jupyter_notebook.widgets', registry = __warningregistry__, module_globals = globals) diff --git a/jupyter_notebook/widgets/interaction.py b/jupyter_notebook/widgets/interaction.py index b924c9b..05d747e 100644 --- a/jupyter_notebook/widgets/interaction.py +++ b/jupyter_notebook/widgets/interaction.py @@ -12,7 +12,7 @@ except ImportError: from inspect import getcallargs from IPython.core.getipython import get_ipython -from IPython.html.widgets import (Widget, Text, +from jupyter_notebook.widgets import (Widget, Text, FloatSlider, IntSlider, Checkbox, Dropdown, Box, Button, DOMWidget) from IPython.display import display, clear_output diff --git a/jupyter_notebook/widgets/tests/test_interaction.py b/jupyter_notebook/widgets/tests/test_interaction.py index 999c5a3..5f9b702 100644 --- a/jupyter_notebook/widgets/tests/test_interaction.py +++ b/jupyter_notebook/widgets/tests/test_interaction.py @@ -13,8 +13,8 @@ except ImportError: import nose.tools as nt from IPython.kernel.comm import Comm -from IPython.html import widgets -from IPython.html.widgets import interact, interactive, Widget, interaction +from jupyter_notebook import widgets +from jupyter_notebook.widgets import interact, interactive, Widget, interaction from IPython.utils.py3compat import annotate #----------------------------------------------------------------------------- diff --git a/jupyter_notebook/widgets/tests/test_traits.py b/jupyter_notebook/widgets/tests/test_traits.py index 474743b..5ac4d58 100644 --- a/jupyter_notebook/widgets/tests/test_traits.py +++ b/jupyter_notebook/widgets/tests/test_traits.py @@ -6,7 +6,7 @@ from unittest import TestCase from IPython.utils.traitlets import HasTraits from traitlets.tests.test_traitlets import TraitTestBase -from IPython.html.widgets import Color, EventfulDict, EventfulList +from jupyter_notebook.widgets import Color, EventfulDict, EventfulList class ColorTrait(HasTraits): diff --git a/jupyter_notebook/widgets/widget_output.py b/jupyter_notebook/widgets/widget_output.py index e786481..777cf09 100644 --- a/jupyter_notebook/widgets/widget_output.py +++ b/jupyter_notebook/widgets/widget_output.py @@ -21,7 +21,7 @@ class Output(DOMWidget): displayed in it instead of the standard output area. Example - from IPython.html import widgets + from jupyter_notebook import widgets from IPython.display import display out = widgets.Output() display(out)