##// END OF EJS Templates
Make `SelectionWidget.values` a dict...
Make `SelectionWidget.values` a dict rename 'labels' and '_value' to 'value_names' and 'value_name'. To specify a mapping of value names and values, use a dict. If you specify `values=[list]`, then an OrderedDict will be used. Assignment after construction only supports a dict.

File last commit:

r14044:c016ca7e
r15024:7b94a2e2
Show More
handlers.py
25 lines | 704 B | text/x-python | PythonLexer
import json
from tornado import web
from ...base.handlers import IPythonHandler, json_errors
class NbconvertRootHandler(IPythonHandler):
SUPPORTED_METHODS = ('GET',)
@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 = {}
info['output_mimetype'] = exporter.output_mimetype
self.finish(json.dumps(res))
default_handlers = [
(r"/api/nbconvert", NbconvertRootHandler),
]