Show More
@@ -66,27 +66,49 b' else:' | |||||
66 |
|
66 | |||
67 | # aliases and flags |
|
67 | # aliases and flags | |
68 |
|
68 | |||
69 | base_aliases = { |
|
69 | base_aliases = {} | |
70 | 'profile-dir' : 'ProfileDir.location', |
|
70 | if isinstance(Application.aliases, dict): | |
71 | 'profile' : 'BaseIPythonApplication.profile', |
|
71 | # traitlets 5 | |
72 | 'ipython-dir' : 'BaseIPythonApplication.ipython_dir', |
|
72 | base_aliases.update(Application.aliases) | |
73 | 'log-level' : 'Application.log_level', |
|
73 | base_aliases.update( | |
74 | 'config' : 'BaseIPythonApplication.extra_config_file', |
|
74 | { | |
75 | } |
|
75 | "profile-dir": "ProfileDir.location", | |
76 |
|
76 | "profile": "BaseIPythonApplication.profile", | ||
77 | base_flags = dict( |
|
77 | "ipython-dir": "BaseIPythonApplication.ipython_dir", | |
78 | debug = ({'Application' : {'log_level' : logging.DEBUG}}, |
|
78 | "log-level": "Application.log_level", | |
79 | "set log level to logging.DEBUG (maximize logging output)"), |
|
79 | "config": "BaseIPythonApplication.extra_config_file", | |
80 | quiet = ({'Application' : {'log_level' : logging.CRITICAL}}, |
|
80 | } | |
81 | "set log level to logging.CRITICAL (minimize logging output)"), |
|
81 | ) | |
82 | init = ({'BaseIPythonApplication' : { |
|
82 | ||
83 | 'copy_config_files' : True, |
|
83 | base_flags = dict() | |
84 | 'auto_create' : True} |
|
84 | if isinstance(Application.flags, dict): | |
85 | }, """Initialize profile with default config files. This is equivalent |
|
85 | # traitlets 5 | |
|
86 | base_flags.update(Application.flags) | |||
|
87 | base_flags.update( | |||
|
88 | dict( | |||
|
89 | debug=( | |||
|
90 | {"Application": {"log_level": logging.DEBUG}}, | |||
|
91 | "set log level to logging.DEBUG (maximize logging output)", | |||
|
92 | ), | |||
|
93 | quiet=( | |||
|
94 | {"Application": {"log_level": logging.CRITICAL}}, | |||
|
95 | "set log level to logging.CRITICAL (minimize logging output)", | |||
|
96 | ), | |||
|
97 | init=( | |||
|
98 | { | |||
|
99 | "BaseIPythonApplication": { | |||
|
100 | "copy_config_files": True, | |||
|
101 | "auto_create": True, | |||
|
102 | } | |||
|
103 | }, | |||
|
104 | """Initialize profile with default config files. This is equivalent | |||
86 |
|
|
105 | to running `ipython profile create <profile>` prior to startup. | |
87 |
|
|
106 | """, | |
|
107 | ), | |||
|
108 | ) | |||
88 | ) |
|
109 | ) | |
89 |
|
110 | |||
|
111 | ||||
90 | class ProfileAwareConfigLoader(PyFileConfigLoader): |
|
112 | class ProfileAwareConfigLoader(PyFileConfigLoader): | |
91 | """A Python file config loader that is aware of IPython profiles.""" |
|
113 | """A Python file config loader that is aware of IPython profiles.""" | |
92 | def load_subconfig(self, fname, path=None, profile=None): |
|
114 | def load_subconfig(self, fname, path=None, profile=None): |
General Comments 0
You need to be logged in to leave comments.
Login now