[Zope3-checkins] SVN: Zope3/branches/3.3/src/zope/app/component/back35.py Added some more compatibility.

Jim Fulton jim at zope.com
Mon Jul 31 11:47:52 EDT 2006


Log message for revision 69307:
  Added some more compatibility.
  

Changed:
  U   Zope3/branches/3.3/src/zope/app/component/back35.py

-=-
Modified: Zope3/branches/3.3/src/zope/app/component/back35.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/component/back35.py	2006-07-31 11:50:10 UTC (rev 69306)
+++ Zope3/branches/3.3/src/zope/app/component/back35.py	2006-07-31 15:47:51 UTC (rev 69307)
@@ -25,6 +25,7 @@
 
 from persistent import Persistent
 
+from zope import component
 import zope.cachedescriptors.property
 import zope.event
 import zope.schema
@@ -532,7 +533,6 @@
     # See zope.app.component.interfaces.registration.IComponentRegistration
     interface = None
 
-
 class Registered:
     """An adapter from IRegisterable to IRegistered.
 
@@ -546,10 +546,12 @@
         self.registerable = registerable
 
     def registrations(self):
-        rm = zapi.getParent(self.registerable).registrationManager
-        return [reg for reg in rm.values()
-                if (IComponentRegistration.providedBy(reg) and
-                    reg.component is self.registerable)]
+        context = self.registerable
+        return [
+            r
+            for r in component.getSiteManager(context).registeredUtilities()
+            if r.component == context
+            ]
 
 
 class RegistrationManager(BTreeContainer):
@@ -849,6 +851,10 @@
     def __setitem__(self, k, v):
         self.update([(k, v)])
 
+    def __delitem__(self, k):
+        self.update(())
+        del getattr(self.site, self.__name__)[k]
+
 class _OldAdapterRegistrations(_OldUtilityRegistrations):
 
     def _getOldRegistrations(self):



More information about the Zope3-Checkins mailing list