[cig-commits] r15680 - cs/pythia/trunk/pyre/inventory

leif at geodynamics.org leif at geodynamics.org
Fri Sep 18 17:05:02 PDT 2009


Author: leif
Date: 2009-09-18 17:05:02 -0700 (Fri, 18 Sep 2009)
New Revision: 15680

Modified:
   cs/pythia/trunk/pyre/inventory/Inventory.py
Log:
Fixed a bug that prevented _defaults() methods from working.


Modified: cs/pythia/trunk/pyre/inventory/Inventory.py
===================================================================
--- cs/pythia/trunk/pyre/inventory/Inventory.py	2009-09-18 20:16:02 UTC (rev 15679)
+++ cs/pythia/trunk/pyre/inventory/Inventory.py	2009-09-19 00:05:02 UTC (rev 15680)
@@ -178,7 +178,11 @@
             # We intentionally don't call _getDefaultValue() -- at
             # this stage, we don't want anything to happen (files to
             # be opened, components to be instantiated, ...)
-            value = prop.default
+            try:
+                # Pick up any values set by _defaults() methods.
+                value = self._getTraitValue(prop.name)
+            except KeyError:
+                value = prop.default
             
             # The 'isinstance' is a limitation of the framework: e.g.,
             # files and dimensionals to not stringify cleanly.



More information about the CIG-COMMITS mailing list