finish up FilesHandler

- load FilesHandler like everything else
- remove copy/paste leftovers
This commit is contained in:
MinRK 2014-10-16 09:26:27 -07:00
parent a490488f62
commit 868994087f
2 changed files with 5 additions and 12 deletions

View File

@ -1,9 +1,8 @@
"""Base Tornado handlers for the notebook server."""
"""Serve files directly from the ContentsManager."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
import os
import mimetypes
import json
@ -11,11 +10,6 @@ import base64
from tornado import web
try:
from tornado.log import app_log
except ImportError:
app_log = logging.getLogger()
from IPython.html.base.handlers import IPythonHandler
class FilesHandler(IPythonHandler):
@ -49,3 +43,6 @@ class FilesHandler(IPythonHandler):
self.write(model['content'])
self.flush()
default_handlers = [
(r"/files/(.*)", FilesHandler),
]

View File

@ -34,8 +34,6 @@ from jinja2 import Environment, FileSystemLoader
from zmq.eventloop import ioloop
ioloop.install()
from IPython.html.files.handlers import FilesHandler
# check for tornado 3.1.0
msg = "The IPython Notebook requires tornado >= 3.1.0"
try:
@ -188,6 +186,7 @@ class NotebookWebApplication(web.Application):
handlers.extend(load_handlers('tree.handlers'))
handlers.extend(load_handlers('auth.login'))
handlers.extend(load_handlers('auth.logout'))
handlers.extend(load_handlers('files.handlers'))
handlers.extend(load_handlers('notebook.handlers'))
handlers.extend(load_handlers('nbconvert.handlers'))
handlers.extend(load_handlers('kernelspecs.handlers'))
@ -197,9 +196,6 @@ class NotebookWebApplication(web.Application):
handlers.extend(load_handlers('services.sessions.handlers'))
handlers.extend(load_handlers('services.nbconvert.handlers'))
handlers.extend(load_handlers('services.kernelspecs.handlers'))
handlers.append(
(r"/files/(.*)", FilesHandler),
)
handlers.append(
(r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}),
)