[CMF-checkins] SVN: CMF/trunk/GenericSetup/ Renamed 'remove' to 'purge' to be more consistent with other uses of that verb.

Florent Guillaume fg at nuxeo.com
Fri Jan 13 12:02:39 EST 2006


Log message for revision 41305:
  Renamed 'remove' to 'purge' to be more consistent with other uses of that verb.

Changed:
  U   CMF/trunk/GenericSetup/tests/test_utils.py
  U   CMF/trunk/GenericSetup/utils.py

-=-
Modified: CMF/trunk/GenericSetup/tests/test_utils.py
===================================================================
--- CMF/trunk/GenericSetup/tests/test_utils.py	2006-01-13 16:50:12 UTC (rev 41304)
+++ CMF/trunk/GenericSetup/tests/test_utils.py	2006-01-13 17:02:38 UTC (rev 41305)
@@ -126,7 +126,7 @@
   <element value="Foo"/>
   <element value="Bar"/>
  </property>
- <property name="lines2" remove="True">
+ <property name="lines2" purge="True">
   <element value="Foo"/>
   <element value="Bar"/>
  </property>

Modified: CMF/trunk/GenericSetup/utils.py
===================================================================
--- CMF/trunk/GenericSetup/utils.py	2006-01-13 16:50:12 UTC (rev 41304)
+++ CMF/trunk/GenericSetup/utils.py	2006-01-13 17:02:38 UTC (rev 41305)
@@ -686,9 +686,11 @@
                 # are converted to the right type
                 prop_value = self._getNodeText(child).encode('utf-8')
 
-            if (not self.environ.shouldPurge()
-                and not child.hasAttribute('remove')):
-                # If not purge mode and no remove attribute, append to sequence
+            purge = self.environ.shouldPurge()
+            if child.hasAttribute('purge'):
+                purge = self._convertToBoolean(child.getAttribute('purge'))
+            if not purge:
+                # If not purge mode, append to sequence
                 prop = obj.getProperty(prop_id)
                 if isinstance(prop, (tuple, list)):
                     prop_value = tuple(prop) + tuple(prop_value)



More information about the CMF-checkins mailing list