[Checkins] SVN: zope.generic/trunk/src/zope/generic/ fix bug

Dominik Huber dominik.huber at perse.ch
Fri Jun 23 08:53:10 EDT 2006


Log message for revision 68802:
  fix bug
  add Face adapter for ConfigurationClassAdapterBase via __conform__

Changed:
  U   zope.generic/trunk/src/zope/generic/adapter/adapter.py
  U   zope.generic/trunk/src/zope/generic/configuration/helper.py

-=-
Modified: zope.generic/trunk/src/zope/generic/adapter/adapter.py
===================================================================
--- zope.generic/trunk/src/zope/generic/adapter/adapter.py	2006-06-22 22:10:49 UTC (rev 68801)
+++ zope.generic/trunk/src/zope/generic/adapter/adapter.py	2006-06-23 12:53:08 UTC (rev 68802)
@@ -24,6 +24,8 @@
 
 from zope.generic.configuration import IConfigurationType
 from zope.generic.configuration import IConfigurations
+from zope.generic.face import IFace
+from zope.generic.face.adapter import FaceForAttributeFaced
 
 from zope.generic.adapter.property import ConfigurationAdapterProperty
 
@@ -37,6 +39,10 @@
     def __init__(self, context):
         self.__context__ = context
         self.__configurations__ = IConfigurations(context)
+    
+    def __conform__(self, interface):
+        if interface is IFace:
+            return FaceForAttributeFaced(self)
 
 
 

Modified: zope.generic/trunk/src/zope/generic/configuration/helper.py
===================================================================
--- zope.generic/trunk/src/zope/generic/configuration/helper.py	2006-06-22 22:10:49 UTC (rev 68801)
+++ zope.generic/trunk/src/zope/generic/configuration/helper.py	2006-06-23 12:53:08 UTC (rev 68802)
@@ -36,7 +36,6 @@
 
 
 
-
 _marker = object()
 
 def configurationToDict(configuration, all=False):
@@ -74,7 +73,8 @@
         if INestedConfiguration.providedBy(field):
 
             if ISubConfiguration.providedBy(field):
-                data[name] = configurationToDict(value, all)
+                if value:
+                    data[name] = configurationToDict(value, all)
 
             elif ISubConfigurationList.providedBy(field):
                 if ISubConfiguration.providedBy(field.value_type):



More information about the Checkins mailing list