[Zope-CVS] CVS: Products/Event - EventRegistry.py:1.5 IEvent.py:1.3

Martijn Pieters mj@zope.com
Sat, 21 Sep 2002 12:31:09 -0400


Update of /cvs-repository/Products/Event
In directory cvs.zope.org:/tmp/cvs-serv18004

Modified Files:
	EventRegistry.py IEvent.py 
Log Message:
Simplify Event registration by perusing the available module and class name.


=== Products/Event/EventRegistry.py 1.4 => 1.5 ===
--- Products/Event/EventRegistry.py:1.4	Fri Sep 20 14:52:09 2002
+++ Products/Event/EventRegistry.py	Sat Sep 21 12:31:08 2002
@@ -66,15 +66,15 @@
         data = _registry.get(key)
         return data and data['interface']
 
-    def registerEvent(self, key, interface, title, description=None):
+    def registerEvent(self, interface, title, description=None):
         """Register an event interface.
 
-        'key'           unique key for this event (preferably a dotted path)
         'interface'     the event interface to register
         'title'         the title of the interface
         'description'   documentation for the event. If not given, the
                         docstring of the event interface is used instead.
         """
+        key = '%s.%s' % (interface.__module__, interface.__name__)
         if _registry.has_key( key ):
             LOG('EventRegistry', WARNING,
                 'Duplicate registration for event: %s' % key)


=== Products/Event/IEvent.py 1.2 => 1.3 ===
--- Products/Event/IEvent.py:1.2	Thu Sep 19 17:46:53 2002
+++ Products/Event/IEvent.py	Sat Sep 21 12:31:08 2002
@@ -23,8 +23,7 @@
 class IEvent(Interface):
     """The Base interface for Events"""
 
-eventRegistry.registerEvent('Products.Event.IEvent.IEvent', IEvent,
-                            'Base Event')
+eventRegistry.registerEvent(IEvent, 'Base Event')
 
 class IFilterableEvent(IEvent):
     """ A filterable Event """
@@ -34,5 +33,4 @@
         Return filter data for this event.
         """
 
-eventRegistry.registerEvent('Products.Event.IEvent.IFilterableEvent',
-                            IFilterableEvent, 'Filterable Event')
+eventRegistry.registerEvent(IFilterableEvent, 'Filterable Event')