Merge pull request #241 from takluyver/nbconvert-config-dir

Put config_dir in resources in nbconvert handlers
Min RK 11 years ago
commit 0afe9d2b1a

@ -98,7 +98,8 @@ class NbconvertFileHandler(IPythonHandler):
"name": name[:name.rfind('.')],
"modified_date": (model['last_modified']
.strftime(text.date_format))
}
},
"config_dir": self.application.settings['config_dir'],
}
)
except Exception as e:
@ -132,7 +133,10 @@ class NbconvertPostHandler(IPythonHandler):
nbnode = from_dict(model['content'])
try:
output, resources = exporter.from_notebook_node(nbnode)
output, resources = exporter.from_notebook_node(nbnode, resources={
"metadata": {"name": name[:name.rfind('.')],},
"config_dir": self.application.settings['config_dir'],
})
except Exception as e:
raise web.HTTPError(500, "nbconvert failed: %s" % e)

@ -207,6 +207,7 @@ class NotebookWebApplication(web.Application):
websocket_url=ipython_app.websocket_url,
mathjax_url=ipython_app.mathjax_url,
config=ipython_app.config,
config_dir=ipython_app.config_dir,
jinja2_env=env,
terminals_available=False, # Set later if terminals are available
)

Loading…
Cancel
Save