Show More
@@ -1,3 +1,3 | |||||
1 | if __name__ == '__main__': |
|
1 | if __name__ == '__main__': | |
2 |
from |
|
2 | from jupyter_notebook import notebookapp as app | |
3 | app.launch_new_instance() |
|
3 | app.launch_new_instance() |
@@ -29,9 +29,9 from IPython.utils.sysinfo import get_sys_info | |||||
29 | from IPython.config import Application |
|
29 | from IPython.config import Application | |
30 | from IPython.utils.path import filefind |
|
30 | from IPython.utils.path import filefind | |
31 | from IPython.utils.py3compat import string_types |
|
31 | from IPython.utils.py3compat import string_types | |
32 |
from |
|
32 | from jupyter_notebook.utils import is_hidden, url_path_join, url_escape | |
33 |
|
33 | |||
34 |
from |
|
34 | from jupyter_notebook.services.security import csp_report_uri | |
35 |
|
35 | |||
36 | #----------------------------------------------------------------------------- |
|
36 | #----------------------------------------------------------------------------- | |
37 | # Top-level handlers |
|
37 | # Top-level handlers |
@@ -90,7 +90,7 WS_PING_INTERVAL = 30000 | |||||
90 | if os.environ.get('IPYTHON_ALLOW_DRAFT_WEBSOCKETS_FOR_PHANTOMJS', False): |
|
90 | if os.environ.get('IPYTHON_ALLOW_DRAFT_WEBSOCKETS_FOR_PHANTOMJS', False): | |
91 | warnings.warn("""Allowing draft76 websocket connections! |
|
91 | warnings.warn("""Allowing draft76 websocket connections! | |
92 | This should only be done for testing with phantomjs!""") |
|
92 | This should only be done for testing with phantomjs!""") | |
93 |
from |
|
93 | from jupyter_notebook import allow76 | |
94 | WebSocketHandler = allow76.AllowDraftWebSocketHandler |
|
94 | WebSocketHandler = allow76.AllowDraftWebSocketHandler | |
95 | # draft 76 doesn't support ping |
|
95 | # draft 76 doesn't support ping | |
96 | WS_PING_INTERVAL = 0 |
|
96 | WS_PING_INTERVAL = 0 |
@@ -10,7 +10,7 import base64 | |||||
10 |
|
10 | |||
11 | from tornado import web |
|
11 | from tornado import web | |
12 |
|
12 | |||
13 |
from |
|
13 | from jupyter_notebook.base.handlers import IPythonHandler | |
14 |
|
14 | |||
15 | class FilesHandler(IPythonHandler): |
|
15 | class FilesHandler(IPythonHandler): | |
16 | """serve files via ContentsManager""" |
|
16 | """serve files via ContentsManager""" |
@@ -8,8 +8,8 import shutil | |||||
8 |
|
8 | |||
9 | import requests |
|
9 | import requests | |
10 |
|
10 | |||
11 |
from |
|
11 | from jupyter_notebook.utils import url_path_join | |
12 |
from |
|
12 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error | |
13 | from IPython.nbformat import write |
|
13 | from IPython.nbformat import write | |
14 | from IPython.nbformat.v4 import ( |
|
14 | from IPython.nbformat.v4 import ( | |
15 | new_notebook, new_markdown_cell, new_code_cell, new_output, |
|
15 | new_notebook, new_markdown_cell, new_code_cell, new_output, |
@@ -49,7 +49,7 from tornado import httpserver | |||||
49 | from tornado import web |
|
49 | from tornado import web | |
50 | from tornado.log import LogFormatter, app_log, access_log, gen_log |
|
50 | from tornado.log import LogFormatter, app_log, access_log, gen_log | |
51 |
|
51 | |||
52 |
from |
|
52 | from jupyter_notebook import ( | |
53 | DEFAULT_STATIC_FILES_PATH, |
|
53 | DEFAULT_STATIC_FILES_PATH, | |
54 | DEFAULT_TEMPLATE_PATH_LIST, |
|
54 | DEFAULT_TEMPLATE_PATH_LIST, | |
55 | ) |
|
55 | ) | |
@@ -116,7 +116,7 def random_ports(port, n): | |||||
116 |
|
116 | |||
117 | def load_handlers(name): |
|
117 | def load_handlers(name): | |
118 | """Load the (URL pattern, handler) tuples for each component.""" |
|
118 | """Load the (URL pattern, handler) tuples for each component.""" | |
119 |
name = ' |
|
119 | name = 'jupyter_notebook.' + name | |
120 | mod = __import__(name, fromlist=['default_handlers']) |
|
120 | mod = __import__(name, fromlist=['default_handlers']) | |
121 | return mod.default_handlers |
|
121 | return mod.default_handlers | |
122 |
|
122 | |||
@@ -576,7 +576,7 class NotebookApp(BaseIPythonApplication): | |||||
576 | extra_template_paths = List(Unicode, config=True, |
|
576 | extra_template_paths = List(Unicode, config=True, | |
577 | help="""Extra paths to search for serving jinja templates. |
|
577 | help="""Extra paths to search for serving jinja templates. | |
578 |
|
578 | |||
579 |
Can be used to override templates from |
|
579 | Can be used to override templates from jupyter_notebook.templates.""" | |
580 | ) |
|
580 | ) | |
581 | def _extra_template_paths_default(self): |
|
581 | def _extra_template_paths_default(self): | |
582 | return [] |
|
582 | return [] |
@@ -5,8 +5,8 import json | |||||
5 |
|
5 | |||
6 | import requests |
|
6 | import requests | |
7 |
|
7 | |||
8 |
from |
|
8 | from jupyter_notebook.utils import url_path_join | |
9 |
from |
|
9 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase | |
10 |
|
10 | |||
11 |
|
11 | |||
12 | class ConfigAPI(object): |
|
12 | class ConfigAPI(object): |
@@ -15,7 +15,7 import tempfile | |||||
15 |
|
15 | |||
16 | from tornado.web import HTTPError |
|
16 | from tornado.web import HTTPError | |
17 |
|
17 | |||
18 |
from |
|
18 | from jupyter_notebook.utils import ( | |
19 | to_api_path, |
|
19 | to_api_path, | |
20 | to_os_path, |
|
20 | to_os_path, | |
21 | ) |
|
21 | ) |
@@ -20,7 +20,7 from IPython.utils.importstring import import_item | |||||
20 | from IPython.utils.traitlets import Any, Unicode, Bool, TraitError |
|
20 | from IPython.utils.traitlets import Any, Unicode, Bool, TraitError | |
21 | from IPython.utils.py3compat import getcwd, string_types |
|
21 | from IPython.utils.py3compat import getcwd, string_types | |
22 | from IPython.utils import tz |
|
22 | from IPython.utils import tz | |
23 |
from |
|
23 | from jupyter_notebook.utils import ( | |
24 | is_hidden, |
|
24 | is_hidden, | |
25 | to_api_path, |
|
25 | to_api_path, | |
26 | ) |
|
26 | ) |
@@ -7,10 +7,10 import json | |||||
7 |
|
7 | |||
8 | from tornado import gen, web |
|
8 | from tornado import gen, web | |
9 |
|
9 | |||
10 |
from |
|
10 | from jupyter_notebook.utils import url_path_join, url_escape | |
11 | from jupyter_client.jsonutil import date_default |
|
11 | from jupyter_client.jsonutil import date_default | |
12 |
|
12 | |||
13 |
from |
|
13 | from jupyter_notebook.base.handlers import ( | |
14 | IPythonHandler, json_errors, path_regex, |
|
14 | IPythonHandler, json_errors, path_regex, | |
15 | ) |
|
15 | ) | |
16 |
|
16 |
@@ -16,8 +16,8 import requests | |||||
16 | from ..filecheckpoints import GenericFileCheckpoints |
|
16 | from ..filecheckpoints import GenericFileCheckpoints | |
17 |
|
17 | |||
18 | from IPython.config import Config |
|
18 | from IPython.config import Config | |
19 |
from |
|
19 | from jupyter_notebook.utils import url_path_join, url_escape, to_os_path | |
20 |
from |
|
20 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error | |
21 | from IPython.nbformat import read, write, from_dict |
|
21 | from IPython.nbformat import read, write, from_dict | |
22 | from IPython.nbformat.v4 import ( |
|
22 | from IPython.nbformat.v4 import ( | |
23 | new_notebook, new_markdown_cell, |
|
23 | new_notebook, new_markdown_cell, |
@@ -11,7 +11,7 from tornado.ioloop import IOLoop | |||||
11 |
|
11 | |||
12 | from jupyter_client.jsonutil import date_default |
|
12 | from jupyter_client.jsonutil import date_default | |
13 | from IPython.utils.py3compat import cast_unicode |
|
13 | from IPython.utils.py3compat import cast_unicode | |
14 |
from |
|
14 | from jupyter_notebook.utils import url_path_join, url_escape | |
15 |
|
15 | |||
16 | from ...base.handlers import IPythonHandler, json_errors |
|
16 | from ...base.handlers import IPythonHandler, json_errors | |
17 | from ...base.zmqhandlers import AuthenticatedZMQStreamHandler, deserialize_binary_message |
|
17 | from ...base.zmqhandlers import AuthenticatedZMQStreamHandler, deserialize_binary_message |
@@ -14,7 +14,7 from tornado import web | |||||
14 | from IPython.kernel.multikernelmanager import MultiKernelManager |
|
14 | from IPython.kernel.multikernelmanager import MultiKernelManager | |
15 | from IPython.utils.traitlets import List, Unicode, TraitError |
|
15 | from IPython.utils.traitlets import List, Unicode, TraitError | |
16 |
|
16 | |||
17 |
from |
|
17 | from jupyter_notebook.utils import to_os_path | |
18 | from IPython.utils.py3compat import getcwd |
|
18 | from IPython.utils.py3compat import getcwd | |
19 |
|
19 | |||
20 |
|
20 |
@@ -5,8 +5,8 import requests | |||||
5 |
|
5 | |||
6 | from jupyter_client.kernelspec import NATIVE_KERNEL_NAME |
|
6 | from jupyter_client.kernelspec import NATIVE_KERNEL_NAME | |
7 |
|
7 | |||
8 |
from |
|
8 | from jupyter_notebook.utils import url_path_join | |
9 |
from |
|
9 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error | |
10 |
|
10 | |||
11 | class KernelAPI(object): |
|
11 | class KernelAPI(object): | |
12 | """Wrapper for kernel REST API requests""" |
|
12 | """Wrapper for kernel REST API requests""" |
@@ -12,8 +12,8 pjoin = os.path.join | |||||
12 | import requests |
|
12 | import requests | |
13 |
|
13 | |||
14 | from IPython.kernel.kernelspec import NATIVE_KERNEL_NAME |
|
14 | from IPython.kernel.kernelspec import NATIVE_KERNEL_NAME | |
15 |
from |
|
15 | from jupyter_notebook.utils import url_path_join | |
16 |
from |
|
16 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error | |
17 |
|
17 | |||
18 | # Copied from IPython.kernel.tests.test_kernelspec so updating that doesn't |
|
18 | # Copied from IPython.kernel.tests.test_kernelspec so updating that doesn't | |
19 | # break these tests |
|
19 | # break these tests |
@@ -1,7 +1,7 | |||||
1 | import requests |
|
1 | import requests | |
2 |
|
2 | |||
3 |
from |
|
3 | from jupyter_notebook.utils import url_path_join | |
4 |
from |
|
4 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase | |
5 |
|
5 | |||
6 | class NbconvertAPI(object): |
|
6 | class NbconvertAPI(object): | |
7 | """Wrapper for nbconvert API calls.""" |
|
7 | """Wrapper for nbconvert API calls.""" |
@@ -9,7 +9,7 from tornado import web | |||||
9 |
|
9 | |||
10 | from ...base.handlers import IPythonHandler, json_errors |
|
10 | from ...base.handlers import IPythonHandler, json_errors | |
11 | from jupyter_client.jsonutil import date_default |
|
11 | from jupyter_client.jsonutil import date_default | |
12 |
from |
|
12 | from jupyter_notebook.utils import url_path_join, url_escape | |
13 | from IPython.kernel.kernelspec import NoSuchKernel |
|
13 | from IPython.kernel.kernelspec import NoSuchKernel | |
14 |
|
14 | |||
15 |
|
15 |
@@ -15,8 +15,8 from IPython.utils.traitlets import Instance | |||||
15 |
|
15 | |||
16 | class SessionManager(LoggingConfigurable): |
|
16 | class SessionManager(LoggingConfigurable): | |
17 |
|
17 | |||
18 |
kernel_manager = Instance(' |
|
18 | kernel_manager = Instance('jupyter_notebook.services.kernels.kernelmanager.MappingKernelManager') | |
19 |
contents_manager = Instance(' |
|
19 | contents_manager = Instance('jupyter_notebook.services.contents.manager.ContentsManager') | |
20 |
|
20 | |||
21 | # Session database initialized below |
|
21 | # Session database initialized below | |
22 | _cursor = None |
|
22 | _cursor = None |
@@ -5,8 +5,8 from unittest import TestCase | |||||
5 | from tornado import web |
|
5 | from tornado import web | |
6 |
|
6 | |||
7 | from ..sessionmanager import SessionManager |
|
7 | from ..sessionmanager import SessionManager | |
8 |
from |
|
8 | from jupyter_notebook.services.kernels.kernelmanager import MappingKernelManager | |
9 |
from |
|
9 | from jupyter_notebook.services.contents.manager import ContentsManager | |
10 |
|
10 | |||
11 | class DummyKernel(object): |
|
11 | class DummyKernel(object): | |
12 | def __init__(self, kernel_name='python'): |
|
12 | def __init__(self, kernel_name='python'): |
@@ -10,8 +10,8 import time | |||||
10 |
|
10 | |||
11 | pjoin = os.path.join |
|
11 | pjoin = os.path.join | |
12 |
|
12 | |||
13 |
from |
|
13 | from jupyter_notebook.utils import url_path_join | |
14 |
from |
|
14 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase, assert_http_error | |
15 | from IPython.nbformat.v4 import new_notebook |
|
15 | from IPython.nbformat.v4 import new_notebook | |
16 | from IPython.nbformat import write |
|
16 | from IPython.nbformat import write | |
17 |
|
17 |
@@ -299,7 +299,7 define([ | |||||
299 | * JS: |
|
299 | * JS: | |
300 | * IPython.notebook.kernel.widget_manager.create_model({ |
|
300 | * IPython.notebook.kernel.widget_manager.create_model({ | |
301 | * model_name: 'WidgetModel', |
|
301 | * model_name: 'WidgetModel', | |
302 |
* widget_class: ' |
|
302 | * widget_class: 'jupyter_notebook.widgets.widget_int.IntSlider'}) | |
303 | * .then(function(model) { console.log('Create success!', model); }, |
|
303 | * .then(function(model) { console.log('Create success!', model); }, | |
304 | * $.proxy(console.error, console)); |
|
304 | * $.proxy(console.error, console)); | |
305 | * |
|
305 | * |
@@ -8,7 +8,7 if not check_version(terminado.__version__, '0.3.3'): | |||||
8 |
|
8 | |||
9 | from terminado import NamedTermManager |
|
9 | from terminado import NamedTermManager | |
10 | from tornado.log import app_log |
|
10 | from tornado.log import app_log | |
11 |
from |
|
11 | from jupyter_notebook.utils import url_path_join as ujoin | |
12 | from .handlers import TerminalHandler, TermSocket |
|
12 | from .handlers import TerminalHandler, TermSocket | |
13 | from . import api_handlers |
|
13 | from . import api_handlers | |
14 |
|
14 |
@@ -15,7 +15,7 from IPython.nbformat.v4 import (new_notebook, | |||||
15 | new_markdown_cell, new_code_cell, |
|
15 | new_markdown_cell, new_code_cell, | |
16 | new_output) |
|
16 | new_output) | |
17 |
|
17 | |||
18 |
from |
|
18 | from jupyter_notebook.utils import url_path_join | |
19 | from .launchnotebook import NotebookTestBase |
|
19 | from .launchnotebook import NotebookTestBase | |
20 | from IPython.utils import py3compat |
|
20 | from IPython.utils import py3compat | |
21 |
|
21 |
@@ -22,8 +22,8 except ImportError: | |||||
22 | import IPython.testing.decorators as dec |
|
22 | import IPython.testing.decorators as dec | |
23 | from IPython.utils import py3compat |
|
23 | from IPython.utils import py3compat | |
24 | from IPython.utils.tempdir import TemporaryDirectory |
|
24 | from IPython.utils.tempdir import TemporaryDirectory | |
25 |
from |
|
25 | from jupyter_notebook import nbextensions | |
26 |
from |
|
26 | from jupyter_notebook.nbextensions import install_nbextension, check_nbextension | |
27 |
|
27 | |||
28 |
|
28 | |||
29 | def touch(file, mtime=None): |
|
29 | def touch(file, mtime=None): |
@@ -11,13 +11,13 from traitlets.tests.utils import check_help_all_output | |||||
11 |
|
11 | |||
12 | from IPython.utils.tempdir import TemporaryDirectory |
|
12 | from IPython.utils.tempdir import TemporaryDirectory | |
13 | from IPython.utils.traitlets import TraitError |
|
13 | from IPython.utils.traitlets import TraitError | |
14 |
from |
|
14 | from jupyter_notebook import notebookapp | |
15 | NotebookApp = notebookapp.NotebookApp |
|
15 | NotebookApp = notebookapp.NotebookApp | |
16 |
|
16 | |||
17 |
|
17 | |||
18 | def test_help_output(): |
|
18 | def test_help_output(): | |
19 | """ipython notebook --help-all works""" |
|
19 | """ipython notebook --help-all works""" | |
20 |
check_help_all_output(' |
|
20 | check_help_all_output('jupyter_notebook') | |
21 |
|
21 | |||
22 | def test_server_info_file(): |
|
22 | def test_server_info_file(): | |
23 | nbapp = NotebookApp(profile='nbserver_file_test', log=logging.getLogger()) |
|
23 | nbapp = NotebookApp(profile='nbserver_file_test', log=logging.getLogger()) |
@@ -2,7 +2,7 | |||||
2 | import re |
|
2 | import re | |
3 | import nose.tools as nt |
|
3 | import nose.tools as nt | |
4 |
|
4 | |||
5 |
from |
|
5 | from jupyter_notebook.base.handlers import path_regex | |
6 |
|
6 | |||
7 | try: # py3 |
|
7 | try: # py3 | |
8 | assert_regex = nt.assert_regex |
|
8 | assert_regex = nt.assert_regex |
@@ -8,14 +8,14 import os | |||||
8 | import nose.tools as nt |
|
8 | import nose.tools as nt | |
9 |
|
9 | |||
10 | from traitlets.tests.utils import check_help_all_output |
|
10 | from traitlets.tests.utils import check_help_all_output | |
11 |
from |
|
11 | from jupyter_notebook.utils import url_escape, url_unescape, is_hidden | |
12 | from IPython.utils.tempdir import TemporaryDirectory |
|
12 | from IPython.utils.tempdir import TemporaryDirectory | |
13 |
|
13 | |||
14 |
|
14 | |||
15 | def test_help_output(): |
|
15 | def test_help_output(): | |
16 | """jupyter notebook --help-all works""" |
|
16 | """jupyter notebook --help-all works""" | |
17 | # FIXME: will be jupyter_notebook |
|
17 | # FIXME: will be jupyter_notebook | |
18 |
check_help_all_output(' |
|
18 | check_help_all_output('jupyter_notebook') | |
19 |
|
19 | |||
20 |
|
20 | |||
21 | def test_url_escape(): |
|
21 | def test_url_escape(): |
@@ -18,7 +18,7 casper.notebook_test(function () { | |||||
18 | this.evaluate(function() { |
|
18 | this.evaluate(function() { | |
19 | IPython.notebook.kernel.widget_manager.create_model({ |
|
19 | IPython.notebook.kernel.widget_manager.create_model({ | |
20 | model_name: 'WidgetModel', |
|
20 | model_name: 'WidgetModel', | |
21 |
widget_class: ' |
|
21 | widget_class: 'jupyter_notebook.widgets.widget_int.IntSlider'}) | |
22 | .then(function(model) { |
|
22 | .then(function(model) { | |
23 | console.log('Create success!', model); |
|
23 | console.log('Create success!', model); | |
24 | window.slider_id = model.id; |
|
24 | window.slider_id = model.id; | |
@@ -34,7 +34,7 casper.notebook_test(function () { | |||||
34 | }); |
|
34 | }); | |
35 |
|
35 | |||
36 | index = this.append_cell( |
|
36 | index = this.append_cell( | |
37 |
'from |
|
37 | 'from jupyter_notebook.widgets import Widget\n' + | |
38 | 'widget = list(Widget.widgets.values())[0]\n' + |
|
38 | 'widget = list(Widget.widgets.values())[0]\n' + | |
39 | 'print(widget.model_id)'); |
|
39 | 'print(widget.model_id)'); | |
40 | this.execute_cell_then(index, function(index) { |
|
40 | this.execute_cell_then(index, function(index) { | |
@@ -45,7 +45,7 casper.notebook_test(function () { | |||||
45 |
|
45 | |||
46 | // Widget persistence tests. |
|
46 | // Widget persistence tests. | |
47 | index = this.append_cell( |
|
47 | index = this.append_cell( | |
48 |
'from |
|
48 | 'from jupyter_notebook.widgets import HTML\n' + | |
49 | 'from IPython.display import display\n' + |
|
49 | 'from IPython.display import display\n' + | |
50 | 'display(HTML(value="<div id=\'hello\'></div>"))'); |
|
50 | 'display(HTML(value="<div id=\'hello\'></div>"))'); | |
51 | this.execute_cell_then(index, function() {}); |
|
51 | this.execute_cell_then(index, function() {}); |
@@ -40,7 +40,7 casper.notebook_test(function () { | |||||
40 | var index; |
|
40 | var index; | |
41 |
|
41 | |||
42 | index = this.append_cell( |
|
42 | index = this.append_cell( | |
43 |
['from |
|
43 | ['from jupyter_notebook import widgets', | |
44 | 'from IPython.display import display, clear_output', |
|
44 | 'from IPython.display import display, clear_output', | |
45 | 'print("Success")'].join('\n')); |
|
45 | 'print("Success")'].join('\n')); | |
46 | this.execute_cell_then(index); |
|
46 | this.execute_cell_then(index); | |
@@ -184,7 +184,7 casper.notebook_test(function () { | |||||
184 |
|
184 | |||
185 | var testwidget = {}; |
|
185 | var testwidget = {}; | |
186 | this.append_cell_execute_then([ |
|
186 | this.append_cell_execute_then([ | |
187 |
'from |
|
187 | 'from jupyter_notebook import widgets', | |
188 | 'from IPython.utils.traitlets import Unicode, Instance, List', |
|
188 | 'from IPython.utils.traitlets import Unicode, Instance, List', | |
189 | 'from IPython.display import display', |
|
189 | 'from IPython.display import display', | |
190 | 'from array import array', |
|
190 | 'from array import array', |
@@ -4,7 +4,7 casper.notebook_test(function () { | |||||
4 |
|
4 | |||
5 | // Create a checkbox and togglebutton. |
|
5 | // Create a checkbox and togglebutton. | |
6 | var bool_index = this.append_cell( |
|
6 | var bool_index = this.append_cell( | |
7 |
'from |
|
7 | 'from jupyter_notebook import widgets\n' + | |
8 | 'from IPython.display import display, clear_output\n' + |
|
8 | 'from IPython.display import display, clear_output\n' + | |
9 | 'bool_widgets = [widgets.Checkbox(description="Title", value=True),\n' + |
|
9 | 'bool_widgets = [widgets.Checkbox(description="Title", value=True),\n' + | |
10 | ' widgets.ToggleButton(description="Title", value=True)]\n' + |
|
10 | ' widgets.ToggleButton(description="Title", value=True)]\n' + |
@@ -3,7 +3,7 casper.notebook_test(function () { | |||||
3 |
|
3 | |||
4 | // Create a box widget. |
|
4 | // Create a box widget. | |
5 | var container_index = this.append_cell( |
|
5 | var container_index = this.append_cell( | |
6 |
'from |
|
6 | 'from jupyter_notebook import widgets\n' + | |
7 | 'from IPython.display import display, clear_output\n' + |
|
7 | 'from IPython.display import display, clear_output\n' + | |
8 | 'container = widgets.Box()\n' + |
|
8 | 'container = widgets.Box()\n' + | |
9 | 'button = widgets.Button()\n'+ |
|
9 | 'button = widgets.Button()\n'+ |
@@ -1,7 +1,7 | |||||
1 | // Test widget button class |
|
1 | // Test widget button class | |
2 | casper.notebook_test(function () { |
|
2 | casper.notebook_test(function () { | |
3 | var button_index = this.append_cell( |
|
3 | var button_index = this.append_cell( | |
4 |
'from |
|
4 | 'from jupyter_notebook import widgets\n' + | |
5 | 'from IPython.display import display, clear_output\n' + |
|
5 | 'from IPython.display import display, clear_output\n' + | |
6 | 'button = widgets.Button(description="Title")\n' + |
|
6 | 'button = widgets.Button(description="Title")\n' + | |
7 | 'display(button)\n' + |
|
7 | 'display(button)\n' + |
@@ -3,7 +3,7 casper.notebook_test(function () { | |||||
3 | var float_text = {}; |
|
3 | var float_text = {}; | |
4 | float_text.query = '.widget-area .widget-subarea .my-second-float-text input'; |
|
4 | float_text.query = '.widget-area .widget-subarea .my-second-float-text input'; | |
5 | float_text.index = this.append_cell( |
|
5 | float_text.index = this.append_cell( | |
6 |
'from |
|
6 | 'from jupyter_notebook import widgets\n' + | |
7 | 'from IPython.display import display, clear_output\n' + |
|
7 | 'from IPython.display import display, clear_output\n' + | |
8 | 'float_widget = widgets.FloatText()\n' + |
|
8 | 'float_widget = widgets.FloatText()\n' + | |
9 | 'display(float_widget)\n' + |
|
9 | 'display(float_widget)\n' + |
@@ -2,7 +2,7 | |||||
2 | casper.notebook_test(function () { |
|
2 | casper.notebook_test(function () { | |
3 | "use strict"; |
|
3 | "use strict"; | |
4 | var index = this.append_cell( |
|
4 | var index = this.append_cell( | |
5 |
'from |
|
5 | 'from jupyter_notebook import widgets\n' + | |
6 | 'from IPython.display import display, clear_output\n' + |
|
6 | 'from IPython.display import display, clear_output\n' + | |
7 | 'print("Success")'); |
|
7 | 'print("Success")'); | |
8 | this.execute_cell_then(index); |
|
8 | this.execute_cell_then(index); |
@@ -3,7 +3,7 casper.notebook_test(function () { | |||||
3 | var int_text = {}; |
|
3 | var int_text = {}; | |
4 | int_text.query = '.widget-area .widget-subarea .my-second-int-text input'; |
|
4 | int_text.query = '.widget-area .widget-subarea .my-second-int-text input'; | |
5 | int_text.index = this.append_cell( |
|
5 | int_text.index = this.append_cell( | |
6 |
'from |
|
6 | 'from jupyter_notebook import widgets\n' + | |
7 | 'from IPython.display import display, clear_output\n' + |
|
7 | 'from IPython.display import display, clear_output\n' + | |
8 | 'int_widget = widgets.IntText()\n' + |
|
8 | 'int_widget = widgets.IntText()\n' + | |
9 | 'display(int_widget)\n' + |
|
9 | 'display(int_widget)\n' + |
@@ -1,7 +1,7 | |||||
1 | // Test selection class |
|
1 | // Test selection class | |
2 | casper.notebook_test(function () { |
|
2 | casper.notebook_test(function () { | |
3 | index = this.append_cell( |
|
3 | index = this.append_cell( | |
4 |
'from |
|
4 | 'from jupyter_notebook import widgets\n' + | |
5 | 'from IPython.display import display, clear_output\n' + |
|
5 | 'from IPython.display import display, clear_output\n' + | |
6 | 'print("Success")'); |
|
6 | 'print("Success")'); | |
7 | this.execute_cell_then(index); |
|
7 | this.execute_cell_then(index); |
@@ -1,7 +1,7 | |||||
1 | // Test multicontainer class |
|
1 | // Test multicontainer class | |
2 | casper.notebook_test(function () { |
|
2 | casper.notebook_test(function () { | |
3 | index = this.append_cell( |
|
3 | index = this.append_cell( | |
4 |
'from |
|
4 | 'from jupyter_notebook import widgets\n' + | |
5 | 'from IPython.display import display, clear_output\n' + |
|
5 | 'from IPython.display import display, clear_output\n' + | |
6 | 'print("Success")'); |
|
6 | 'print("Success")'); | |
7 | this.execute_cell_then(index); |
|
7 | this.execute_cell_then(index); |
@@ -1,7 +1,7 | |||||
1 | // Test widget string class |
|
1 | // Test widget string class | |
2 | casper.notebook_test(function () { |
|
2 | casper.notebook_test(function () { | |
3 | var string_index = this.append_cell( |
|
3 | var string_index = this.append_cell( | |
4 |
'from |
|
4 | 'from jupyter_notebook import widgets\n' + | |
5 | 'from IPython.display import display, clear_output\n' + |
|
5 | 'from IPython.display import display, clear_output\n' + | |
6 | 'string_widget = [widgets.Text(value = "xyz", placeholder = "abc"),\n' + |
|
6 | 'string_widget = [widgets.Text(value = "xyz", placeholder = "abc"),\n' + | |
7 | ' widgets.Textarea(value = "xyz", placeholder = "def"),\n' + |
|
7 | ' widgets.Textarea(value = "xyz", placeholder = "def"),\n' + |
@@ -1,13 +1,13 | |||||
1 | """Test the /tree handlers""" |
|
1 | """Test the /tree handlers""" | |
2 | import os |
|
2 | import os | |
3 | import io |
|
3 | import io | |
4 |
from |
|
4 | from jupyter_notebook.utils import url_path_join | |
5 | from IPython.nbformat import write |
|
5 | from IPython.nbformat import write | |
6 | from IPython.nbformat.v4 import new_notebook |
|
6 | from IPython.nbformat.v4 import new_notebook | |
7 |
|
7 | |||
8 | import requests |
|
8 | import requests | |
9 |
|
9 | |||
10 |
from |
|
10 | from jupyter_notebook.tests.launchnotebook import NotebookTestBase | |
11 |
|
11 | |||
12 | class TreeTest(NotebookTestBase): |
|
12 | class TreeTest(NotebookTestBase): | |
13 | def setUp(self): |
|
13 | def setUp(self): |
@@ -31,10 +31,10 from .widget_string import HTMLWidget, LatexWidget, TextWidget, TextareaWidget | |||||
31 | # To ignore this warning, do: |
|
31 | # To ignore this warning, do: | |
32 | # |
|
32 | # | |
33 | # from warnings import filterwarnings |
|
33 | # from warnings import filterwarnings | |
34 |
# filterwarnings('ignore', module=' |
|
34 | # filterwarnings('ignore', module='jupyter_notebook.widgets') | |
35 |
|
35 | |||
36 | from warnings import warn_explicit |
|
36 | from warnings import warn_explicit | |
37 | __warningregistry__ = {} |
|
37 | __warningregistry__ = {} | |
38 | warn_explicit("IPython widgets are experimental and may change in the future.", |
|
38 | warn_explicit("IPython widgets are experimental and may change in the future.", | |
39 |
FutureWarning, '', 0, module = ' |
|
39 | FutureWarning, '', 0, module = 'jupyter_notebook.widgets', | |
40 | registry = __warningregistry__, module_globals = globals) |
|
40 | registry = __warningregistry__, module_globals = globals) |
@@ -12,7 +12,7 except ImportError: | |||||
12 | from inspect import getcallargs |
|
12 | from inspect import getcallargs | |
13 |
|
13 | |||
14 | from IPython.core.getipython import get_ipython |
|
14 | from IPython.core.getipython import get_ipython | |
15 |
from |
|
15 | from jupyter_notebook.widgets import (Widget, Text, | |
16 | FloatSlider, IntSlider, Checkbox, Dropdown, |
|
16 | FloatSlider, IntSlider, Checkbox, Dropdown, | |
17 | Box, Button, DOMWidget) |
|
17 | Box, Button, DOMWidget) | |
18 | from IPython.display import display, clear_output |
|
18 | from IPython.display import display, clear_output |
@@ -13,8 +13,8 except ImportError: | |||||
13 | import nose.tools as nt |
|
13 | import nose.tools as nt | |
14 |
|
14 | |||
15 | from IPython.kernel.comm import Comm |
|
15 | from IPython.kernel.comm import Comm | |
16 |
from |
|
16 | from jupyter_notebook import widgets | |
17 |
from |
|
17 | from jupyter_notebook.widgets import interact, interactive, Widget, interaction | |
18 | from IPython.utils.py3compat import annotate |
|
18 | from IPython.utils.py3compat import annotate | |
19 |
|
19 | |||
20 | #----------------------------------------------------------------------------- |
|
20 | #----------------------------------------------------------------------------- |
@@ -6,7 +6,7 | |||||
6 | from unittest import TestCase |
|
6 | from unittest import TestCase | |
7 | from IPython.utils.traitlets import HasTraits |
|
7 | from IPython.utils.traitlets import HasTraits | |
8 | from traitlets.tests.test_traitlets import TraitTestBase |
|
8 | from traitlets.tests.test_traitlets import TraitTestBase | |
9 |
from |
|
9 | from jupyter_notebook.widgets import Color, EventfulDict, EventfulList | |
10 |
|
10 | |||
11 |
|
11 | |||
12 | class ColorTrait(HasTraits): |
|
12 | class ColorTrait(HasTraits): |
@@ -21,7 +21,7 class Output(DOMWidget): | |||||
21 | displayed in it instead of the standard output area. |
|
21 | displayed in it instead of the standard output area. | |
22 |
|
22 | |||
23 | Example |
|
23 | Example | |
24 |
from |
|
24 | from jupyter_notebook import widgets | |
25 | from IPython.display import display |
|
25 | from IPython.display import display | |
26 | out = widgets.Output() |
|
26 | out = widgets.Output() | |
27 | display(out) |
|
27 | display(out) |
General Comments 0
You need to be logged in to leave comments.
Login now