[cig-commits] r6766 - in cs/pythia/trunk/pyre: applications inventory

leif at geodynamics.org leif at geodynamics.org
Thu May 3 13:29:10 PDT 2007


Author: leif
Date: 2007-05-03 13:29:10 -0700 (Thu, 03 May 2007)
New Revision: 6766

Modified:
   cs/pythia/trunk/pyre/applications/Shell.py
   cs/pythia/trunk/pyre/inventory/ConfigContext.py
Log:
Show app usage only if there are "unrecognized property" or "unknown
component" errors.


Modified: cs/pythia/trunk/pyre/applications/Shell.py
===================================================================
--- cs/pythia/trunk/pyre/applications/Shell.py	2007-05-03 20:13:13 UTC (rev 6765)
+++ cs/pythia/trunk/pyre/applications/Shell.py	2007-05-03 20:29:10 UTC (rev 6766)
@@ -138,7 +138,8 @@
             method = getattr(app, message)
             method(*args, **kwds)
         else:
-            app.usage()
+            if context.showUsage:
+                app.usage()
             import sys
             sys.exit("%s: configuration error(s)" % app.name)
 

Modified: cs/pythia/trunk/pyre/inventory/ConfigContext.py
===================================================================
--- cs/pythia/trunk/pyre/inventory/ConfigContext.py	2007-05-03 20:13:13 UTC (rev 6765)
+++ cs/pythia/trunk/pyre/inventory/ConfigContext.py	2007-05-03 20:29:10 UTC (rev 6766)
@@ -45,10 +45,12 @@
 
     def unknownComponent(self, name, registry):
         self.unknownComponents.attachNode(registry)
+        self.showUsage = True
 
 
     def unrecognizedProperty(self, name, value, locator):
         self.unrecognizedProperties.setProperty(name, value, locator)
+        self.showUsage = True
 
 
     def configureComponent(self, component):
@@ -164,6 +166,8 @@
 
         self.pp = None
 
+        self.showUsage = False
+
         return
 
 



More information about the cig-commits mailing list