[Zope-Checkins] CVS: Zope3/lib/python/Zope/Event - hooks.py:1.1.2.2 EventChannel.py:1.1.2.2

Chris Withers chrisw@nipltd.com
Sat, 23 Feb 2002 14:37:54 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Event
In directory cvs.zope.org:/tmp/cvs-serv29638

Modified Files:
      Tag: Zope-3x-branch
	hooks.py EventChannel.py 
Log Message:
Fixed non-functioning _clear

=== Zope3/lib/python/Zope/Event/hooks.py 1.1.2.1 => 1.1.2.2 ===
 from EventService import EventService
 
-def _clear():
-    # clear module-level data structures
-    global _eventService, publishEvent, subscribe, unsubscribe
-    _eventService = EventService()
-    publishEvent = _eventService.publishEvent
-    subscribe = _eventService.subscribe
-    unsubscribe = _eventService.unsubscribe
-
-# set up module level data structures    
-_clear()
+_eventService = EventService()
+publishEvent = _eventService.publishEvent
+subscribe = _eventService.subscribe
+unsubscribe = _eventService.unsubscribe
 
+_clear = _eventService._clear
 
 # Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
 from Zope.Testing.CleanUp import addCleanUp


=== Zope3/lib/python/Zope/Event/EventChannel.py 1.1.2.1 => 1.1.2.2 ===
         self._subscribers = {}
         
+    _clear = __init__
+    
     def subscribe(self, subscriber, event_types=(None,), filter=None):
 
         subs = self._subscribers