[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/ Fixed component handler to use 'for' not 'for_' in adapter directive. To support import of existing profiles 'for_' is used as a fallback.

Laurence Rowe l at lrowe.co.uk
Fri Sep 18 11:27:38 EDT 2009


Log message for revision 104347:
  Fixed component handler to use 'for' not 'for_' in adapter directive. To support import of existing profiles 'for_' is used as a fallback.

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
  U   Products.GenericSetup/trunk/Products/GenericSetup/components.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt	2009-09-18 15:18:53 UTC (rev 104346)
+++ Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt	2009-09-18 15:27:38 UTC (rev 104347)
@@ -4,6 +4,9 @@
 GenericSetup 1.5.0 (unreleased)
 -------------------------------
 
+- Fixed component handler to use 'for' not 'for_' in adapter directive. To
+  support import of existing profiles 'for_' is used as a fallback.
+
 - Changed testing.py to directly load zope.traversing's ZCML instead of going
   via the Five traversing.zcml BBB shim.
 

Modified: Products.GenericSetup/trunk/Products/GenericSetup/components.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/components.py	2009-09-18 15:18:53 UTC (rev 104346)
+++ Products.GenericSetup/trunk/Products/GenericSetup/components.py	2009-09-18 15:27:38 UTC (rev 104347)
@@ -132,11 +132,10 @@
             provided = _resolveDottedName(provided)
             name = unicode(str(child.getAttribute('name')))
 
-            for_ = child.getAttribute('for_')
+            for_ = child.getAttribute('for') or child.getAttribute('for_') #BBB
             required = []
-            for interface in for_.split(u' '):
-                if interface:
-                    required.append(_resolveDottedName(interface))
+            for interface in for_.split():
+                required.append(_resolveDottedName(interface))
 
             self.context.registerAdapter(factory,
                                          required=required,
@@ -269,7 +268,7 @@
 
             child.setAttribute('factory', reg_info['factory'])
             child.setAttribute('provides', reg_info['provided'])
-            child.setAttribute('for_', for_.strip())
+            child.setAttribute('for', for_.strip())
             if reg_info['name']:
                 child.setAttribute('name', reg_info['name'])
 



More information about the checkins mailing list