[CMF-checkins] SVN: CMF/trunk/GenericSetup/utils.py - added NodeAdapterBase._convertToBoolean()

Yvo Schubbe y.2005- at wcm-solutions.de
Wed Oct 12 04:31:30 EDT 2005


Log message for revision 39088:
  - added NodeAdapterBase._convertToBoolean()
  - removed NodeAdapterBase._getNodeTextBoolean()

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

-=-
Modified: CMF/trunk/GenericSetup/utils.py
===================================================================
--- CMF/trunk/GenericSetup/utils.py	2005-10-12 08:23:19 UTC (rev 39087)
+++ CMF/trunk/GenericSetup/utils.py	2005-10-12 08:31:29 UTC (rev 39088)
@@ -433,11 +433,9 @@
             text += '\n'.join(lines)
         return text
 
-    def _getNodeTextBoolean(self, node):
-        text = self._getNodeText(node)
-        return text.lower() in ('true', 'yes', '1')
+    def _convertToBoolean(self, val):
+        return val.lower() in ('true', 'yes', '1')
 
-
 class ObjectManagerHelpers(object):
 
     """ObjectManager im- and export helpers.
@@ -575,7 +573,7 @@
             if elements or prop_map.get('type') == 'multiple selection':
                 prop_value = tuple(elements) or ()
             elif prop_map.get('type') == 'boolean':
-                prop_value = self._getNodeTextBoolean(child)
+                prop_value = self._convertToBoolean(self._getNodeText(child))
             else:
                 # if we pass a *string* to _updateProperty, all other values
                 # are converted to the right type



More information about the CMF-checkins mailing list