Show More
@@ -72,7 +72,7 b" subcommand 'cmd', do: `{app} cmd -h`." | |||
|
72 | 72 | #----------------------------------------------------------------------------- |
|
73 | 73 | |
|
74 | 74 | @decorator |
|
75 | def catch_config(method, app, *args, **kwargs): | |
|
75 | def catch_config_error(method, app, *args, **kwargs): | |
|
76 | 76 | """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. |
|
77 | 77 | |
|
78 | 78 | On a TraitError (generally caused by bad config), this will print the trait's |
@@ -195,7 +195,7 b' class Application(SingletonConfigurable):' | |||
|
195 | 195 | self._log_handler.setFormatter(self._log_formatter) |
|
196 | 196 | self.log.addHandler(self._log_handler) |
|
197 | 197 | |
|
198 | @catch_config | |
|
198 | @catch_config_error | |
|
199 | 199 | def initialize(self, argv=None): |
|
200 | 200 | """Do the basic steps to configure me. |
|
201 | 201 | |
@@ -340,7 +340,7 b' class Application(SingletonConfigurable):' | |||
|
340 | 340 | # events. |
|
341 | 341 | self.config = newconfig |
|
342 | 342 | |
|
343 | @catch_config | |
|
343 | @catch_config_error | |
|
344 | 344 | def initialize_subcommand(self, subc, argv=None): |
|
345 | 345 | """Initialize a subcommand with argv.""" |
|
346 | 346 | subapp,help = self.subcommands.get(subc) |
@@ -400,7 +400,7 b' class Application(SingletonConfigurable):' | |||
|
400 | 400 | flags[key] = (newflag, help) |
|
401 | 401 | return flags, aliases |
|
402 | 402 | |
|
403 | @catch_config | |
|
403 | @catch_config_error | |
|
404 | 404 | def parse_command_line(self, argv=None): |
|
405 | 405 | """Parse the command line arguments.""" |
|
406 | 406 | argv = sys.argv[1:] if argv is None else argv |
@@ -432,7 +432,7 b' class Application(SingletonConfigurable):' | |||
|
432 | 432 | # store unparsed args in extra_args |
|
433 | 433 | self.extra_args = loader.extra_args |
|
434 | 434 | |
|
435 | @catch_config | |
|
435 | @catch_config_error | |
|
436 | 436 | def load_config_file(self, filename, path=None): |
|
437 | 437 | """Load a .py based config file by filename and path.""" |
|
438 | 438 | loader = PyFileConfigLoader(filename, path=path) |
@@ -34,7 +34,7 b' import os' | |||
|
34 | 34 | import shutil |
|
35 | 35 | import sys |
|
36 | 36 | |
|
37 | from IPython.config.application import Application, catch_config | |
|
37 | from IPython.config.application import Application, catch_config_error | |
|
38 | 38 | from IPython.config.configurable import Configurable |
|
39 | 39 | from IPython.config.loader import Config, ConfigFileNotFound |
|
40 | 40 | from IPython.core import release, crashhandler |
@@ -304,7 +304,7 b' class BaseIPythonApplication(Application):' | |||
|
304 | 304 | with open(fname, 'w') as f: |
|
305 | 305 | f.write(s) |
|
306 | 306 | |
|
307 | @catch_config | |
|
307 | @catch_config_error | |
|
308 | 308 | def initialize(self, argv=None): |
|
309 | 309 | # don't hook up crash handler before parsing command-line |
|
310 | 310 | self.parse_command_line(argv) |
@@ -43,7 +43,7 b' from .handlers import (LoginHandler,' | |||
|
43 | 43 | ) |
|
44 | 44 | from .notebookmanager import NotebookManager |
|
45 | 45 | |
|
46 | from IPython.config.application import catch_config | |
|
46 | from IPython.config.application import catch_config_error | |
|
47 | 47 | from IPython.core.application import BaseIPythonApplication |
|
48 | 48 | from IPython.core.profiledir import ProfileDir |
|
49 | 49 | from IPython.zmq.session import Session, default_secure |
@@ -261,7 +261,7 b' class NotebookApp(BaseIPythonApplication):' | |||
|
261 | 261 | # and all of its ancenstors until propagate is set to False. |
|
262 | 262 | self.log.propagate = False |
|
263 | 263 | |
|
264 | @catch_config | |
|
264 | @catch_config_error | |
|
265 | 265 | def initialize(self, argv=None): |
|
266 | 266 | super(NotebookApp, self).initialize(argv) |
|
267 | 267 | self.init_configurables() |
@@ -29,7 +29,7 b' import uuid' | |||
|
29 | 29 | from IPython.external.qt import QtGui |
|
30 | 30 | |
|
31 | 31 | # Local imports |
|
32 | from IPython.config.application import boolean_flag, catch_config | |
|
32 | from IPython.config.application import boolean_flag, catch_config_error | |
|
33 | 33 | from IPython.core.application import BaseIPythonApplication |
|
34 | 34 | from IPython.core.profiledir import ProfileDir |
|
35 | 35 | from IPython.lib.kernel import tunnel_to_kernel, find_connection_file |
@@ -516,7 +516,7 b' class IPythonQtConsoleApp(BaseIPythonApplication):' | |||
|
516 | 516 | else: |
|
517 | 517 | raise IOError("Stylesheet %r not found."%self.stylesheet) |
|
518 | 518 | |
|
519 | @catch_config | |
|
519 | @catch_config_error | |
|
520 | 520 | def initialize(self, argv=None): |
|
521 | 521 | super(IPythonQtConsoleApp, self).initialize(argv) |
|
522 | 522 | self.init_connection_file() |
@@ -32,7 +32,7 b' import sys' | |||
|
32 | 32 | from IPython.config.loader import ( |
|
33 | 33 | Config, PyFileConfigLoader, ConfigFileNotFound |
|
34 | 34 | ) |
|
35 | from IPython.config.application import boolean_flag, catch_config | |
|
35 | from IPython.config.application import boolean_flag, catch_config_error | |
|
36 | 36 | from IPython.core import release |
|
37 | 37 | from IPython.core import usage |
|
38 | 38 | from IPython.core.completer import Completer |
@@ -286,7 +286,7 b' class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):' | |||
|
286 | 286 | |
|
287 | 287 | return super(TerminalIPythonApp, self).parse_command_line(argv) |
|
288 | 288 | |
|
289 | @catch_config | |
|
289 | @catch_config_error | |
|
290 | 290 | def initialize(self, argv=None): |
|
291 | 291 | """Do actions after construct, but before starting the app.""" |
|
292 | 292 | super(TerminalIPythonApp, self).initialize(argv) |
@@ -29,7 +29,7 b' import sys' | |||
|
29 | 29 | |
|
30 | 30 | from subprocess import Popen, PIPE |
|
31 | 31 | |
|
32 | from IPython.config.application import catch_config | |
|
32 | from IPython.config.application import catch_config_error | |
|
33 | 33 | from IPython.core import release |
|
34 | 34 | from IPython.core.crashhandler import CrashHandler |
|
35 | 35 | from IPython.core.application import ( |
@@ -145,7 +145,7 b' class BaseParallelApplication(BaseIPythonApplication):' | |||
|
145 | 145 | aliases = Dict(base_aliases) |
|
146 | 146 | flags = Dict(base_flags) |
|
147 | 147 | |
|
148 | @catch_config | |
|
148 | @catch_config_error | |
|
149 | 149 | def initialize(self, argv=None): |
|
150 | 150 | """initialize the app""" |
|
151 | 151 | super(BaseParallelApplication, self).initialize(argv) |
@@ -31,7 +31,7 b' from subprocess import check_call, CalledProcessError, PIPE' | |||
|
31 | 31 | import zmq |
|
32 | 32 | from zmq.eventloop import ioloop |
|
33 | 33 | |
|
34 | from IPython.config.application import Application, boolean_flag, catch_config | |
|
34 | from IPython.config.application import Application, boolean_flag, catch_config_error | |
|
35 | 35 | from IPython.config.loader import Config |
|
36 | 36 | from IPython.core.application import BaseIPythonApplication |
|
37 | 37 | from IPython.core.profiledir import ProfileDir |
@@ -269,7 +269,7 b' class IPClusterEngines(BaseParallelApplication):' | |||
|
269 | 269 | flags = Dict(engine_flags) |
|
270 | 270 | _stopping = False |
|
271 | 271 | |
|
272 | @catch_config | |
|
272 | @catch_config_error | |
|
273 | 273 | def initialize(self, argv=None): |
|
274 | 274 | super(IPClusterEngines, self).initialize(argv) |
|
275 | 275 | self.init_signal() |
@@ -41,7 +41,7 b' from IPython.parallel.apps.baseapp import (' | |||
|
41 | 41 | BaseParallelApplication, |
|
42 | 42 | base_aliases, |
|
43 | 43 | base_flags, |
|
44 | catch_config, | |
|
44 | catch_config_error, | |
|
45 | 45 | ) |
|
46 | 46 | from IPython.utils.importstring import import_item |
|
47 | 47 | from IPython.utils.traitlets import Instance, Unicode, Bool, List, Dict, TraitError |
@@ -388,7 +388,7 b' class IPControllerApp(BaseParallelApplication):' | |||
|
388 | 388 | self.log.addHandler(handler) |
|
389 | 389 | self._log_handler = handler |
|
390 | 390 | |
|
391 | @catch_config | |
|
391 | @catch_config_error | |
|
392 | 392 | def initialize(self, argv=None): |
|
393 | 393 | super(IPControllerApp, self).initialize(argv) |
|
394 | 394 | self.forward_logging() |
@@ -34,7 +34,7 b' from IPython.parallel.apps.baseapp import (' | |||
|
34 | 34 | BaseParallelApplication, |
|
35 | 35 | base_aliases, |
|
36 | 36 | base_flags, |
|
37 | catch_config, | |
|
37 | catch_config_error, | |
|
38 | 38 | ) |
|
39 | 39 | from IPython.zmq.log import EnginePUBHandler |
|
40 | 40 | from IPython.zmq.session import ( |
@@ -319,7 +319,7 b' class IPEngineApp(BaseParallelApplication):' | |||
|
319 | 319 | else: |
|
320 | 320 | mpi = None |
|
321 | 321 | |
|
322 | @catch_config | |
|
322 | @catch_config_error | |
|
323 | 323 | def initialize(self, argv=None): |
|
324 | 324 | super(IPEngineApp, self).initialize(argv) |
|
325 | 325 | self.init_mpi() |
@@ -31,7 +31,7 b' from IPython.utils.traitlets import Bool, Dict, Unicode' | |||
|
31 | 31 | from IPython.parallel.apps.baseapp import ( |
|
32 | 32 | BaseParallelApplication, |
|
33 | 33 | base_aliases, |
|
34 | catch_config, | |
|
34 | catch_config_error, | |
|
35 | 35 | ) |
|
36 | 36 | from IPython.parallel.apps.logwatcher import LogWatcher |
|
37 | 37 | |
@@ -69,7 +69,7 b' class IPLoggerApp(BaseParallelApplication):' | |||
|
69 | 69 | classes = [LogWatcher, ProfileDir] |
|
70 | 70 | aliases = Dict(aliases) |
|
71 | 71 | |
|
72 | @catch_config | |
|
72 | @catch_config_error | |
|
73 | 73 | def initialize(self, argv=None): |
|
74 | 74 | super(IPLoggerApp, self).initialize(argv) |
|
75 | 75 | self.init_watcher() |
@@ -28,7 +28,7 b' import zmq' | |||
|
28 | 28 | |
|
29 | 29 | # Local imports. |
|
30 | 30 | from IPython.config.configurable import Configurable |
|
31 | from IPython.config.application import boolean_flag, catch_config | |
|
31 | from IPython.config.application import boolean_flag, catch_config_error | |
|
32 | 32 | from IPython.core.application import ProfileDir |
|
33 | 33 | from IPython.core.error import StdinNotImplementedError |
|
34 | 34 | from IPython.core.shellapp import ( |
@@ -731,7 +731,7 b' class IPKernelApp(KernelApp, InteractiveShellApp):' | |||
|
731 | 731 | """ |
|
732 | 732 | ) |
|
733 | 733 | |
|
734 | @catch_config | |
|
734 | @catch_config_error | |
|
735 | 735 | def initialize(self, argv=None): |
|
736 | 736 | super(IPKernelApp, self).initialize(argv) |
|
737 | 737 | self.init_shell() |
@@ -26,7 +26,7 b' import zmq' | |||
|
26 | 26 | # IPython imports. |
|
27 | 27 | from IPython.core.ultratb import FormattedTB |
|
28 | 28 | from IPython.core.application import ( |
|
29 | BaseIPythonApplication, base_flags, base_aliases, catch_config | |
|
29 | BaseIPythonApplication, base_flags, base_aliases, catch_config_error | |
|
30 | 30 | ) |
|
31 | 31 | from IPython.utils import io |
|
32 | 32 | from IPython.utils.localinterfaces import LOCALHOST |
@@ -275,7 +275,7 b' class KernelApp(BaseIPythonApplication):' | |||
|
275 | 275 | ) |
|
276 | 276 | self.kernel.record_ports(self.ports) |
|
277 | 277 | |
|
278 | @catch_config | |
|
278 | @catch_config_error | |
|
279 | 279 | def initialize(self, argv=None): |
|
280 | 280 | super(KernelApp, self).initialize(argv) |
|
281 | 281 | self.init_blackhole() |
General Comments 0
You need to be logged in to leave comments.
Login now