|
|
|
|
@ -8,6 +8,7 @@ import os
|
|
|
|
|
import zipfile
|
|
|
|
|
|
|
|
|
|
from tornado import web, escape
|
|
|
|
|
from tornado.log import app_log
|
|
|
|
|
|
|
|
|
|
from ..base.handlers import (
|
|
|
|
|
IPythonHandler, FilesRedirectHandler,
|
|
|
|
|
@ -70,6 +71,7 @@ def get_exporter(format, **kwargs):
|
|
|
|
|
try:
|
|
|
|
|
return Exporter(**kwargs)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
app_log.exception("Could not construct Exporter: %s", Exporter)
|
|
|
|
|
raise web.HTTPError(500, "Could not construct Exporter: %s" % e)
|
|
|
|
|
|
|
|
|
|
class NbconvertFileHandler(IPythonHandler):
|
|
|
|
|
@ -103,6 +105,7 @@ class NbconvertFileHandler(IPythonHandler):
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
self.log.exception("nbconvert failed: %s", e)
|
|
|
|
|
raise web.HTTPError(500, "nbconvert failed: %s" % e)
|
|
|
|
|
|
|
|
|
|
if respond_zip(self, name, output, resources):
|
|
|
|
|
|