Skip to content

Commit

Permalink
Merge pull request #241 from takluyver/nbconvert-config-dir
Browse files Browse the repository at this point in the history
Put config_dir in resources in nbconvert handlers
  • Loading branch information
minrk committed Jul 28, 2015
2 parents 2633494 + 7e4354f commit 0afe9d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions notebook/nbconvert/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def get(self, format, path):
"name": name[:name.rfind('.')],
"modified_date": (model['last_modified']
.strftime(text.date_format))
}
},
"config_dir": self.application.settings['config_dir'],
}
)
except Exception as e:
Expand Down Expand Up @@ -132,7 +133,10 @@ def post(self, format):
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)

Expand Down
1 change: 1 addition & 0 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def init_settings(self, ipython_app, kernel_manager, contents_manager,
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
)
Expand Down

0 comments on commit 0afe9d2

Please sign in to comment.