Show More
@@ -16,6 +16,7 b' from ..base.handlers import (' | |||
|
16 | 16 | from IPython.nbformat import from_dict |
|
17 | 17 | |
|
18 | 18 | from IPython.utils.py3compat import cast_bytes |
|
19 | from IPython.utils import text | |
|
19 | 20 | |
|
20 | 21 | def find_resource_files(output_files_dir): |
|
21 | 22 | files = [] |
@@ -89,7 +90,16 b' class NbconvertFileHandler(IPythonHandler):' | |||
|
89 | 90 | self.set_header('Last-Modified', model['last_modified']) |
|
90 | 91 | |
|
91 | 92 | try: |
|
92 |
output, resources = exporter.from_notebook_node( |
|
|
93 | output, resources = exporter.from_notebook_node( | |
|
94 | model['content'], | |
|
95 | resources={ | |
|
96 | "metadata": { | |
|
97 | "name": name[:name.rfind('.')], | |
|
98 | "modified_date": (model['last_modified'] | |
|
99 | .strftime(text.date_format)) | |
|
100 | } | |
|
101 | } | |
|
102 | ) | |
|
93 | 103 | except Exception as e: |
|
94 | 104 | raise web.HTTPError(500, "nbconvert failed: %s" % e) |
|
95 | 105 |
@@ -241,7 +241,9 b' class Exporter(LoggingConfigurable):' | |||
|
241 | 241 | #Make sure the metadata extension exists in resources |
|
242 | 242 | if 'metadata' in resources: |
|
243 | 243 | if not isinstance(resources['metadata'], ResourcesDict): |
|
244 |
|
|
|
244 | new_metadata = ResourcesDict() | |
|
245 | new_metadata.update(resources['metadata']) | |
|
246 | resources['metadata'] = new_metadata | |
|
245 | 247 | else: |
|
246 | 248 | resources['metadata'] = ResourcesDict() |
|
247 | 249 | if not resources['metadata']['name']: |
General Comments 0
You need to be logged in to leave comments.
Login now