[Checkins] SVN: zope.site/trunk/src/zope/site/site.py * propagate the event instead of creating a new one (this transports more information to the subscribers, namely which object in the parent chain was moved)

Wolfgang Schnerring wosc at wosc.de
Thu Jul 30 12:41:59 EDT 2009


Log message for revision 102379:
  * propagate the event instead of creating a new one (this transports more information to the subscribers, namely which object in the parent chain was moved)
  * propagate all moved events (add, move, delete), not just remove
  

Changed:
  U   zope.site/trunk/src/zope/site/site.py

-=-
Modified: zope.site/trunk/src/zope/site/site.py
===================================================================
--- zope.site/trunk/src/zope/site/site.py	2009-07-30 16:27:04 UTC (rev 102378)
+++ zope.site/trunk/src/zope/site/site.py	2009-07-30 16:41:59 UTC (rev 102379)
@@ -229,7 +229,7 @@
 
 @zope.component.adapter(
     SiteManagerContainer,
-    zope.container.interfaces.IObjectRemovedEvent)
+    zope.container.interfaces.IObjectMovedEvent)
 def siteManagerContainerRemoved(container, event):
     # The relation between SiteManagerContainer and LocalSiteManager is a
     # kind of containment hierarchy, but it is not expressed via containment,
@@ -243,7 +243,5 @@
     except ComponentLookupError:
         pass
     else:
-        zope.event.notify(zope.container.contained.ObjectRemovedEvent(
-            sm, container))
-
-
+        for ignored in zope.component.subscribers((sm, event), None):
+            pass # work happens during adapter fetch



More information about the Checkins mailing list