[Zope3-checkins] CVS: Zope3/src/zope/app/event - globalservice.py:1.8.10.1 objectevent.py:1.4.16.1 subs.py:1.13.10.1

Grégoire Weber zope@i-con.ch
Sun, 22 Jun 2003 10:24:01 -0400


Update of /cvs-repository/Zope3/src/zope/app/event
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/event

Modified Files:
      Tag: cw-mail-branch
	globalservice.py objectevent.py subs.py 
Log Message:
Synced up with HEAD

=== Zope3/src/zope/app/event/globalservice.py 1.8 => 1.8.10.1 ===
--- Zope3/src/zope/app/event/globalservice.py:1.8	Thu May  1 15:35:15 2003
+++ Zope3/src/zope/app/event/globalservice.py	Sun Jun 22 10:23:00 2003
@@ -20,9 +20,10 @@
 __metaclass__ = type
 
 from zope.interface.type import TypeRegistry
+from zope.interface import implements
 from zope.component import queryAdapter
 from zope.exceptions import NotFoundError
-from zope.proxy.introspection import removeAllProxies
+from zope.proxy import removeAllProxies
 
 from zope.app.interfaces.event import IEvent, ISubscriber, ISubscribingAware
 from zope.app.interfaces.event import IGlobalSubscribable, IPublisher
@@ -55,7 +56,7 @@
 
     if filter is not None:
         filter = _context.resolve(filter)
-        
+
     return [
         Action(
              # subscriptions can never conflict
@@ -72,7 +73,7 @@
     events sent out by Zope.
     """
 
-    __implements__ = ISubscriber
+    implements(ISubscriber)
 
     def __init__(self, severity=logging.INFO):
         self.severity = severity
@@ -95,7 +96,7 @@
 class GlobalSubscribable:
     """A global mix-in"""
 
-    __implements__ = IGlobalSubscribable
+    implements(IGlobalSubscribable)
 
     def __init__(self):
         self._registry = TypeRegistry()
@@ -239,14 +240,14 @@
 
 class GlobalEventChannel(GlobalSubscribable):
 
-    __implements__ = IGlobalSubscribable, ISubscriber
+    implements(IGlobalSubscribable, ISubscriber)
 
     notify = globalNotifyOrPublish
 
 
 class GlobalEventPublisher(GlobalSubscribable):
 
-    __implements__ = IGlobalSubscribable, IPublisher
+    implements(IGlobalSubscribable, IPublisher)
 
     publish = globalNotifyOrPublish
 


=== Zope3/src/zope/app/event/objectevent.py 1.4 => 1.4.16.1 ===
--- Zope3/src/zope/app/event/objectevent.py:1.4	Wed Mar 19 14:57:27 2003
+++ Zope3/src/zope/app/event/objectevent.py	Sun Jun 22 10:23:00 2003
@@ -25,13 +25,14 @@
 from zope.app.interfaces.event import IObjectAnnotationsModifiedEvent
 from zope.app.interfaces.event import IObjectContentModifiedEvent
 from zope.app.traversing import getPath
+from zope.interface import implements
 
 _marker = object()
 
 class ObjectEvent:
     """Something has happened to an object"""
 
-    __implements__ = IObjectEvent
+    implements(IObjectEvent)
 
     def _getLocation(self):
         if self.__location is not _marker:
@@ -47,37 +48,37 @@
 class ObjectAddedEvent(ObjectEvent):
     """An object has been added to a container"""
 
-    __implements__ = IObjectAddedEvent
+    implements(IObjectAddedEvent)
 
 class ObjectCreatedEvent(ObjectEvent):
     """An object has been created"""
 
-    __implements__ = IObjectCreatedEvent
+    implements(IObjectCreatedEvent)
 
 class ObjectModifiedEvent(ObjectEvent):
     """An object has been modified"""
 
-    __implements__ = IObjectModifiedEvent
+    implements(IObjectModifiedEvent)
 
 class ObjectAnnotationsModifiedEvent(ObjectModifiedEvent):
     """An object's annotations have been modified"""
 
-    __implements__ = IObjectAnnotationsModifiedEvent
+    implements(IObjectAnnotationsModifiedEvent)
 
 class ObjectContentModifiedEvent(ObjectModifiedEvent):
     """An object's content has been modified"""
 
-    __implements__ = IObjectContentModifiedEvent
+    implements(IObjectContentModifiedEvent)
 
 class ObjectRemovedEvent(ObjectEvent):
     """An object has been removed from a container"""
 
-    __implements__ = IObjectRemovedEvent
+    implements(IObjectRemovedEvent)
 
 class ObjectMovedEvent(ObjectAddedEvent):
     """An object has been moved"""
 
-    __implements__ = IObjectMovedEvent
+    implements(IObjectMovedEvent)
 
     fromLocation = None
 
@@ -88,7 +89,7 @@
 class ObjectCopiedEvent(ObjectAddedEvent):
     """An object has been copied"""
 
-    __implements__ = IObjectCopiedEvent
+    implements(IObjectCopiedEvent)
 
     fromLocation = None
 


=== Zope3/src/zope/app/event/subs.py 1.13 => 1.13.10.1 ===
--- Zope3/src/zope/app/event/subs.py:1.13	Thu May  1 15:35:15 2003
+++ Zope3/src/zope/app/event/subs.py	Sun Jun 22 10:23:00 2003
@@ -24,8 +24,8 @@
 
 from types import StringTypes
 
-from zope.proxy.context import ContextMethod
-from zope.proxy.introspection import removeAllProxies
+from zope.context import ContextMethod
+from zope.proxy import removeAllProxies
 
 from zope.app.traversing import getPath
 from zope.app.traversing import canonicalPath, traverse
@@ -37,6 +37,7 @@
 from zope.app.services.type import PersistentTypeRegistry
 from cPickle import dumps, PicklingError
 import logging
+from zope.interface import implements
 
 __metaclass__ = type
 
@@ -53,7 +54,7 @@
 class Subscribable(Persistent):
     """A local mix-in"""
 
-    __implements__ = ISubscribable
+    implements(ISubscribable)
 
     def __init__(self):
         # the type registry
@@ -104,8 +105,9 @@
         subscribers = clean_self._registry.get(ev_type)
         if subscribers is None:
             subscribers = []
-            clean_self._registry.register(ev_type, subscribers)
         subscribers.append((token, filter))
+        # Ensure that type registry is triggered for persistence
+        clean_self._registry.register(ev_type, subscribers)
 
         # increment the subscription count for this subscriber
         if reftype is int:
@@ -435,7 +437,7 @@
 class SubscriptionTracker:
     "Mix-in for subscribers that want to know to whom they are subscribed"
 
-    __implements__ = ISubscribingAware
+    implements(ISubscribingAware)
 
     def __init__(self):
         self._subscriptions = ()