Show More
@@ -88,9 +88,7 b' def catch_config_error(method, app, *args, **kwargs):' | |||
|
88 | 88 | try: |
|
89 | 89 | return method(app, *args, **kwargs) |
|
90 | 90 | except (TraitError, ArgumentError) as e: |
|
91 | app.print_description() | |
|
92 | 91 | app.print_help() |
|
93 | app.print_examples() | |
|
94 | 92 | app.log.fatal("Bad config encountered during initialization:") |
|
95 | 93 | app.log.fatal(str(e)) |
|
96 | 94 | app.log.debug("Config at the time: %s", app.config) |
@@ -337,6 +335,7 b' class Application(SingletonConfigurable):' | |||
|
337 | 335 | |
|
338 | 336 | If classes=False (the default), only flags and aliases are printed. |
|
339 | 337 | """ |
|
338 | self.print_description() | |
|
340 | 339 | self.print_subcommands() |
|
341 | 340 | self.print_options() |
|
342 | 341 | |
@@ -356,6 +355,9 b' class Application(SingletonConfigurable):' | |||
|
356 | 355 | print "To see all available configurables, use `--help-all`" |
|
357 | 356 | |
|
358 | 357 | |
|
358 | self.print_examples() | |
|
359 | ||
|
360 | ||
|
359 | 361 | def print_description(self): |
|
360 | 362 | """Print the application description.""" |
|
361 | 363 | for p in wrap_paragraphs(self.description): |
@@ -475,9 +477,7 b' class Application(SingletonConfigurable):' | |||
|
475 | 477 | interpreted_argv = argv |
|
476 | 478 | |
|
477 | 479 | if any(x in interpreted_argv for x in ('-h', '--help-all', '--help')): |
|
478 | self.print_description() | |
|
479 | 480 | self.print_help('--help-all' in interpreted_argv) |
|
480 | self.print_examples() | |
|
481 | 481 | self.exit(0) |
|
482 | 482 | |
|
483 | 483 | if '--version' in interpreted_argv or '-V' in interpreted_argv: |
@@ -209,24 +209,14 b' class NbConvertApp(BaseIPythonApplication):' | |||
|
209 | 209 | "\n\t" + "\n\t".join(get_export_names()), |
|
210 | 210 | file=sys.stderr) |
|
211 | 211 | sys.exit(-1) |
|
212 | # except Exception as e: | |
|
213 | # print("Error: could not export '%s'" % notebook_filename, file=sys.stderr) | |
|
214 | # print(e, file=sys.stderr) | |
|
215 | 212 | else: |
|
216 | 213 | self.writer.write(output, resources, notebook_name=notebook_name) |
|
217 | 214 | conversion_success += 1 |
|
218 | 215 | |
|
219 | 216 | # If nothing was converted successfully, help the user. |
|
220 | 217 | if conversion_success == 0: |
|
221 | ||
|
222 | # No notebooks were specified, show help. | |
|
223 | if len(self.notebooks) == 0: | |
|
224 | self.print_help() | |
|
225 | ||
|
226 | # Notebooks were specified, but not converted successfully. Show how | |
|
227 | # to access help. | |
|
228 | else: | |
|
229 | print('For help, use "ipython nbconvert --help"') | |
|
218 | self.print_help() | |
|
219 | sys.exit(-1) | |
|
230 | 220 | |
|
231 | 221 | |
|
232 | 222 | #----------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now