[cig-commits] r6368 - cs/pythia/trunk/pyre/applications

leif at geodynamics.org leif at geodynamics.org
Fri Mar 23 10:31:52 PDT 2007


Author: leif
Date: 2007-03-23 10:31:52 -0700 (Fri, 23 Mar 2007)
New Revision: 6368

Modified:
   cs/pythia/trunk/pyre/applications/Shell.py
Log:
If help or command-completion is requested, don't call init()/_init()
or verifyConfiguration().  This prevents configuration/validation
checks from breaking help/command-completion.  In the future, help
mode may move closer to a no-op -- in particular, _validate() might
not be called under help, as it is now.


Modified: cs/pythia/trunk/pyre/applications/Shell.py
===================================================================
--- cs/pythia/trunk/pyre/applications/Shell.py	2007-03-23 17:13:06 UTC (rev 6367)
+++ cs/pythia/trunk/pyre/applications/Shell.py	2007-03-23 17:31:52 UTC (rev 6368)
@@ -100,21 +100,10 @@
         # start fresh
         context = app.newConfigContext()
         
-        # initialize the application
+        # configure the application
         app.updateConfiguration(app.registry)
         app.applyConfiguration(context)
 
-        # verify that the application input did not contain any typos
-        if not app.verifyConfiguration(context, app.inventory.typos):
-            app.usage()
-            import sys
-            sys.exit("%s: configuration error(s)" % app.name)
-
-        app.init()
-
-        # print a startup page
-        app.generateBanner()
-
         # the main application behavior
         action = action and getattr(app, action)
         if action:
@@ -123,10 +112,19 @@
             app.version()
         elif app._helpRequested:
             app.help()
-        else:
+        elif app.verifyConfiguration(context, app.inventory.typos):
+            app.init()
+
+            # print a startup page
+            app.generateBanner()
+
             message = kwds.get('message', 'execute')
             method = getattr(app, message)
             method(*args, **kwds)
+        else:
+            app.usage()
+            import sys
+            sys.exit("%s: configuration error(s)" % app.name)
 
         # shutdown
         app.fini()



More information about the cig-commits mailing list