Show More
@@ -278,6 +278,11 b' class NbConvertApp(BaseIPythonApplication):' | |||
|
278 | 278 | basename = os.path.basename(notebook_filename) |
|
279 | 279 | notebook_name = basename[:basename.rfind('.')] |
|
280 | 280 | if self.output_base: |
|
281 | # strip duplicate extension from output_base, to avoid Basname.ext.ext | |
|
282 | if getattr(exporter, 'file_extension', False): | |
|
283 | base, ext = os.path.splitext(self.output_base) | |
|
284 | if ext == '.' + exporter.file_extension: | |
|
285 | self.output_base = base | |
|
281 | 286 | notebook_name = self.output_base |
|
282 | 287 | resources = {} |
|
283 | 288 | resources['profile_dir'] = self.profile_dir.location |
@@ -293,11 +298,11 b' class NbConvertApp(BaseIPythonApplication):' | |||
|
293 | 298 | exc_info=True) |
|
294 | 299 | self.exit(1) |
|
295 | 300 | else: |
|
296 |
write_result |
|
|
301 | write_results = self.writer.write(output, resources, notebook_name=notebook_name) | |
|
297 | 302 | |
|
298 | 303 | #Post-process if post processor has been defined. |
|
299 | 304 | if hasattr(self, 'postprocessor') and self.postprocessor: |
|
300 |
self.postprocessor(write_result |
|
|
305 | self.postprocessor(write_results) | |
|
301 | 306 | conversion_success += 1 |
|
302 | 307 | |
|
303 | 308 | # If nothing was converted successfully, help the user. |
@@ -127,6 +127,16 b' class TestNbConvertApp(TestsBase):' | |||
|
127 | 127 | with open('notebook2.slides.html') as f: |
|
128 | 128 | assert '/reveal.css' in f.read() |
|
129 | 129 | |
|
130 | def test_output_ext(self): | |
|
131 | """test --output=outputfile[.ext]""" | |
|
132 | with self.create_temp_cwd(['notebook1.ipynb']): | |
|
133 | self.call('nbconvert --log-level 0 --to python ' | |
|
134 | 'notebook1.ipynb --output nb.py') | |
|
135 | assert os.path.exists('nb.py') | |
|
136 | ||
|
137 | self.call('nbconvert --log-level 0 --to python ' | |
|
138 | 'notebook1.ipynb --output nb2') | |
|
139 | assert os.path.exists('nb2.py') | |
|
130 | 140 | |
|
131 | 141 | def test_glob_explicit(self): |
|
132 | 142 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now