From 6f7b1203e92ff77e0b68eed729dd37adcf24a1ce 2013-05-15 19:25:33 From: Brian E. Granger Date: 2013-05-15 19:25:33 Subject: [PATCH] Updating import statements after moving notebook files around. --- diff --git a/IPython/frontend/html/notebook/auth/login.py b/IPython/frontend/html/notebook/auth/login.py index f63cc8b..51ab621 100644 --- a/IPython/frontend/html/notebook/auth/login.py +++ b/IPython/frontend/html/notebook/auth/login.py @@ -22,7 +22,7 @@ from tornado.escape import url_escape from IPython.lib.security import passwd_check -from .base import IPythonHandler +from ..base.handlers import IPythonHandler #----------------------------------------------------------------------------- # Handler diff --git a/IPython/frontend/html/notebook/auth/logout.py b/IPython/frontend/html/notebook/auth/logout.py index 43cefc3..43a1326 100644 --- a/IPython/frontend/html/notebook/auth/logout.py +++ b/IPython/frontend/html/notebook/auth/logout.py @@ -16,7 +16,7 @@ Authors: # Imports #----------------------------------------------------------------------------- -from .base import IPythonHandler +from ..base.handlers import IPythonHandler #----------------------------------------------------------------------------- # Handler diff --git a/IPython/frontend/html/notebook/clusters/handlers.py b/IPython/frontend/html/notebook/clusters/handlers.py index 486ada3..8f107d9 100644 --- a/IPython/frontend/html/notebook/clusters/handlers.py +++ b/IPython/frontend/html/notebook/clusters/handlers.py @@ -20,7 +20,7 @@ from tornado import web from zmq.utils import jsonapi -from .base import IPythonHandler +from ..base.handlers import IPythonHandler #----------------------------------------------------------------------------- # Cluster handlers diff --git a/IPython/frontend/html/notebook/kernels/handlers.py b/IPython/frontend/html/notebook/kernels/handlers.py index 5c59015..67e2d8f 100644 --- a/IPython/frontend/html/notebook/kernels/handlers.py +++ b/IPython/frontend/html/notebook/kernels/handlers.py @@ -27,7 +27,7 @@ from IPython.kernel.zmq.session import Session from IPython.utils.jsonutil import date_default from IPython.utils.py3compat import PY3 -from .base import IPythonHandler +from ..base.handlers import IPythonHandler #----------------------------------------------------------------------------- # Kernel handlers diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py index 75ae14b..dc6dd62 100644 --- a/IPython/frontend/html/notebook/notebookapp.py +++ b/IPython/frontend/html/notebook/notebookapp.py @@ -62,33 +62,14 @@ from tornado import web # Our own libraries from IPython.frontend.html.notebook import DEFAULT_STATIC_FILES_PATH -from .kernelmanager import MappingKernelManager -from .handlers.clustersapi import ( - MainClusterHandler, ClusterProfileHandler, ClusterActionHandler -) -from .handlers.kernelsapi import ( - MainKernelHandler, KernelHandler, KernelActionHandler, - IOPubHandler, StdinHandler, ShellHandler -) -from .handlers.notebooksapi import ( - NotebookRootHandler, NotebookHandler, - NotebookCheckpointsHandler, ModifyNotebookCheckpointsHandler -) -from .handlers.tree import ProjectDashboardHandler -from .handlers.login import LoginHandler -from .handlers.logout import LogoutHandler -from .handlers.notebooks import ( - NewHandler, NamedNotebookHandler, - NotebookCopyHandler, NotebookRedirectHandler -) - -from .handlers.base import AuthenticatedFileHandler -from .handlers.files import FileFindHandler +from .kernels.kernelmanager import MappingKernelManager +from .notebooks.nbmanager import NotebookManager +from .notebooks.filenbmanager import FileNotebookManager +from .clusters.clustermanager import ClusterManager -from .nbmanager import NotebookManager -from .filenbmanager import FileNotebookManager -from .clustermanager import ClusterManager +from .base.handlers import AuthenticatedFileHandler +from .base.files import FileFindHandler from IPython.config.application import catch_config_error, boolean_flag from IPython.core.application import BaseIPythonApplication @@ -140,7 +121,7 @@ def random_ports(port, n): def load_handlers(name): """Load the (URL pattern, handler) tuples for each component.""" - name = 'IPython.frontend.html.notebook.handlers.' + name + name = 'IPython.frontend.html.notebook.' + name mod = __import__(name, fromlist=['default_handlers']) return mod.default_handlers @@ -156,14 +137,14 @@ class NotebookWebApplication(web.Application): # Load the (URL pattern, handler) tuples for each component. handlers = [] - handlers.extend(load_handlers('base')) - handlers.extend(load_handlers('tree')) - handlers.extend(load_handlers('login')) - handlers.extend(load_handlers('logout')) - handlers.extend(load_handlers('notebooks')) - handlers.extend(load_handlers('kernelsapi')) - handlers.extend(load_handlers('notebooksapi')) - handlers.extend(load_handlers('clustersapi')) + handlers.extend(load_handlers('base.handlers')) + handlers.extend(load_handlers('tree.handlers')) + handlers.extend(load_handlers('auth.login')) + handlers.extend(load_handlers('auth.logout')) + handlers.extend(load_handlers('notebooks.handlers')) + handlers.extend(load_handlers('kernels.handlers')) + handlers.extend(load_handlers('notebooks.apihandlers')) + handlers.extend(load_handlers('clusters.handlers')) handlers.extend([ (r"/files/(.*)", AuthenticatedFileHandler, {'path' : notebook_manager.notebook_dir}), ]) @@ -485,7 +466,7 @@ class NotebookApp(BaseIPythonApplication): else: self.log.info("Using MathJax: %s", new) - notebook_manager_class = DottedObjectName('IPython.frontend.html.notebook.filenbmanager.FileNotebookManager', + notebook_manager_class = DottedObjectName('IPython.frontend.html.notebook.notebooks.filenbmanager.FileNotebookManager', config=True, help='The notebook manager class to use.') diff --git a/IPython/frontend/html/notebook/notebooks/apihandlers.py b/IPython/frontend/html/notebook/notebooks/apihandlers.py index a0aa477..8666263 100644 --- a/IPython/frontend/html/notebook/notebooks/apihandlers.py +++ b/IPython/frontend/html/notebook/notebooks/apihandlers.py @@ -22,7 +22,7 @@ from zmq.utils import jsonapi from IPython.utils.jsonutil import date_default -from .base import IPythonHandler, authenticate_unless_readonly +from ..base.handlers import IPythonHandler, authenticate_unless_readonly #----------------------------------------------------------------------------- # Notebook web service handlers diff --git a/IPython/frontend/html/notebook/notebooks/handlers.py b/IPython/frontend/html/notebook/notebooks/handlers.py index 1a51843..4f8d360 100644 --- a/IPython/frontend/html/notebook/notebooks/handlers.py +++ b/IPython/frontend/html/notebook/notebooks/handlers.py @@ -20,7 +20,7 @@ import os from tornado import web HTTPError = web.HTTPError -from .base import IPythonHandler, authenticate_unless_readonly +from ..base.handlers import IPythonHandler, authenticate_unless_readonly from ..utils import url_path_join #----------------------------------------------------------------------------- diff --git a/IPython/frontend/html/notebook/tree/handlers.py b/IPython/frontend/html/notebook/tree/handlers.py index 3133f95..a7b43e6 100644 --- a/IPython/frontend/html/notebook/tree/handlers.py +++ b/IPython/frontend/html/notebook/tree/handlers.py @@ -16,7 +16,7 @@ Authors: # Imports #----------------------------------------------------------------------------- -from .base import IPythonHandler, authenticate_unless_readonly +from ..base.handlers import IPythonHandler, authenticate_unless_readonly #----------------------------------------------------------------------------- # Handlers