|
|
|
|
@ -3,10 +3,6 @@ import json
|
|
|
|
|
from tornado import web
|
|
|
|
|
|
|
|
|
|
from ...base.handlers import IPythonHandler, json_errors
|
|
|
|
|
try:
|
|
|
|
|
from IPython.nbconvert.exporters.export import exporter_map
|
|
|
|
|
except ImportError:
|
|
|
|
|
exporter_map = {}
|
|
|
|
|
|
|
|
|
|
class NbconvertRootHandler(IPythonHandler):
|
|
|
|
|
SUPPORTED_METHODS = ('GET',)
|
|
|
|
|
@ -14,6 +10,10 @@ class NbconvertRootHandler(IPythonHandler):
|
|
|
|
|
@web.authenticated
|
|
|
|
|
@json_errors
|
|
|
|
|
def get(self):
|
|
|
|
|
try:
|
|
|
|
|
from IPython.nbconvert.exporters.export import exporter_map
|
|
|
|
|
except ImportError as e:
|
|
|
|
|
raise web.HTTPError(500, "Could not import nbconvert: %s" % e)
|
|
|
|
|
res = {}
|
|
|
|
|
for format, exporter in exporter_map.items():
|
|
|
|
|
res[format] = info = {}
|
|
|
|
|
|