From f17c77eba09345510b098800fb760dcc257d63ba Mon Sep 17 00:00:00 2001 From: "Brian E. Granger" Date: Wed, 15 May 2013 12:25:33 -0700 Subject: [PATCH] Updating import statements after moving notebook files around. --- IPython/frontend/html/notebook/auth/login.py | 2 +- IPython/frontend/html/notebook/auth/logout.py | 2 +- .../html/notebook/clusters/handlers.py | 2 +- .../html/notebook/kernels/handlers.py | 2 +- IPython/frontend/html/notebook/notebookapp.py | 51 ++++++------------- .../html/notebook/notebooks/apihandlers.py | 2 +- .../html/notebook/notebooks/handlers.py | 2 +- .../frontend/html/notebook/tree/handlers.py | 2 +- 8 files changed, 23 insertions(+), 42 deletions(-) diff --git a/IPython/frontend/html/notebook/auth/login.py b/IPython/frontend/html/notebook/auth/login.py index f63cc8b7a..51ab6218d 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 43cefc333..43a1326d8 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 486ada342..8f107d9ad 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 5c590152f..67e2d8f29 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 75ae14b4e..dc6dd628b 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 .kernels.kernelmanager import MappingKernelManager +from .notebooks.nbmanager import NotebookManager +from .notebooks.filenbmanager import FileNotebookManager +from .clusters.clustermanager import ClusterManager -from .handlers.base import AuthenticatedFileHandler -from .handlers.files import FileFindHandler - -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 a0aa477cb..8666263ae 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 1a5184344..4f8d36035 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 3133f958d..a7b43e6be 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