Skip to content

Commit

Permalink
Merge pull request #233 from minrk/base-flags
Browse files Browse the repository at this point in the history
inherit base aliases/flags from traitlets Application
  • Loading branch information
Steven Silvester authored Aug 3, 2021
2 parents ac47bd9 + b4f6c97 commit 2dc34f7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions jupyter_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,29 @@

# aliases and flags

base_aliases = {
base_aliases = {}
if isinstance(Application.aliases, dict):
# traitlets 5
base_aliases.update(Application.aliases)
_jupyter_aliases = {
'log-level' : 'Application.log_level',
'config' : 'JupyterApp.config_file',
}
base_aliases.update(_jupyter_aliases)

base_flags = {
base_flags = {}
if isinstance(Application.flags, dict):
# traitlets 5
base_flags.update(Application.flags)
_jupyter_flags = {
'debug': ({'Application' : {'log_level' : logging.DEBUG}},
"set log level to logging.DEBUG (maximize logging output)"),
'generate-config': ({'JupyterApp': {'generate_config': True}},
"generate default config file"),
'y': ({'JupyterApp': {'answer_yes': True}},
"Answer yes to any questions instead of prompting."),
}
base_flags.update(_jupyter_flags)

class NoStart(Exception):
"""Exception to raise when an application shouldn't start"""
Expand Down

0 comments on commit 2dc34f7

Please sign in to comment.