[Checkins] SVN: Products.GenericSetup/trunk/ - fixed 'lines' and 'tokens' import

Yvo Schubbe y.2010 at wcm-solutions.de
Mon Nov 29 04:21:49 EST 2010


Log message for revision 118633:
  - fixed 'lines' and 'tokens' import

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/tests/test_utils.py
  UU  Products.GenericSetup/trunk/Products/GenericSetup/utils.py
  U   Products.GenericSetup/trunk/docs/CHANGES.rst

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_utils.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tests/test_utils.py	2010-11-29 09:01:19 UTC (rev 118632)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tests/test_utils.py	2010-11-29 09:21:49 UTC (rev 118633)
@@ -150,6 +150,9 @@
    <element value="Foo" remove="True" />
    <element value="Bar" />
   </property>
+ <property name="lines2" purge="False">
+   <element value="Foo" remove="True" />
+  </property>
 </dummy>
 """
 
@@ -453,9 +456,11 @@
         obj = helpers.context
         obj._properties = ()
         obj.manage_addProperty('lines1', ('Foo', 'Gee'), 'lines')
+        obj.manage_addProperty('lines2', ('Foo', 'Gee'), 'lines')
         helpers._initProperties(node)
 
         self.assertEquals(obj.getProperty('lines1'), ('Gee', 'Bar'))
+        self.assertEquals(obj.getProperty('lines2'), ('Gee',))
 
 class PropertyManagerHelpersNonPMContextTests(PropertyManagerHelpersTests):
 

Modified: Products.GenericSetup/trunk/Products/GenericSetup/utils.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/utils.py	2010-11-29 09:01:19 UTC (rev 118632)
+++ Products.GenericSetup/trunk/Products/GenericSetup/utils.py	2010-11-29 09:21:49 UTC (rev 118633)
@@ -11,8 +11,6 @@
 #
 ##############################################################################
 """ GenericSetup product utilities
-
-$Id$
 """
 
 import os
@@ -734,7 +732,8 @@
                         if value in remove_elements:
                             remove_elements.remove(value)
 
-            if new_elements or prop_map.get('type') == 'multiple selection':
+            if prop_map.get('type') in ('lines', 'tokens',
+                                        'multiple selection'):
                 prop_value = tuple(new_elements) or ()
             elif prop_map.get('type') == 'boolean':
                 prop_value = self._convertToBoolean(self._getNodeText(child))


Property changes on: Products.GenericSetup/trunk/Products/GenericSetup/utils.py
___________________________________________________________________
Deleted: svn:keywords
   - Id

Modified: Products.GenericSetup/trunk/docs/CHANGES.rst
===================================================================
--- Products.GenericSetup/trunk/docs/CHANGES.rst	2010-11-29 09:01:19 UTC (rev 118632)
+++ Products.GenericSetup/trunk/docs/CHANGES.rst	2010-11-29 09:21:49 UTC (rev 118633)
@@ -4,6 +4,9 @@
 1.6.3 (unreleased)
 ------------------
 
+- Property import: Fixed 'lines' and 'tokens' import.
+  Modifying sequences without adding new elements was broken.
+
 - Toolset import: Support replacement of subclassed tools.
 
 1.6.2 (2010-08-12)



More information about the checkins mailing list