From 268c5e778d8b54c6ce6b5040124f020e4aa1846f Mon Sep 17 00:00:00 2001 From: MinRK Date: Sat, 22 Oct 2011 10:46:33 -0700 Subject: [PATCH 1/2] Show invalid config message on TraitErrors during initialization implemented via @catch_config decorator Now, the event that was triggered by invalid app config (see `--log-level 5`) is triggered by bad config at any point during initialization. This *will* catch TraitError bugs in IPython itself, but only during initialization. closes gh-908 --- IPython/frontend/html/notebook/notebookapp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py index d037f95dd..24f275d08 100644 --- a/IPython/frontend/html/notebook/notebookapp.py +++ b/IPython/frontend/html/notebook/notebookapp.py @@ -43,6 +43,7 @@ from .handlers import (LoginHandler, ) from .notebookmanager import NotebookManager +from IPython.config.application import catch_config from IPython.core.application import BaseIPythonApplication from IPython.core.profiledir import ProfileDir from IPython.zmq.session import Session, default_secure @@ -260,6 +261,7 @@ class NotebookApp(BaseIPythonApplication): # and all of its ancenstors until propagate is set to False. self.log.propagate = False + @catch_config def initialize(self, argv=None): super(NotebookApp, self).initialize(argv) self.init_configurables() From 1f7fd1db3fc51a563259d193c093878343667cb0 Mon Sep 17 00:00:00 2001 From: MinRK Date: Fri, 28 Oct 2011 15:22:24 -0700 Subject: [PATCH 2/2] catch_config -> catch_config_error --- IPython/frontend/html/notebook/notebookapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py index 24f275d08..cf259a15d 100644 --- a/IPython/frontend/html/notebook/notebookapp.py +++ b/IPython/frontend/html/notebook/notebookapp.py @@ -43,7 +43,7 @@ from .handlers import (LoginHandler, ) from .notebookmanager import NotebookManager -from IPython.config.application import catch_config +from IPython.config.application import catch_config_error from IPython.core.application import BaseIPythonApplication from IPython.core.profiledir import ProfileDir from IPython.zmq.session import Session, default_secure @@ -261,7 +261,7 @@ class NotebookApp(BaseIPythonApplication): # and all of its ancenstors until propagate is set to False. self.log.propagate = False - @catch_config + @catch_config_error def initialize(self, argv=None): super(NotebookApp, self).initialize(argv) self.init_configurables()