diff MoinMoin/events/__init__.py @ 2318:062b76cf8d48

Introduce an base EventResult class for event handler return values. Make send_notification use a list of jids, instead of one. I'll remove prints tomorrow.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sat, 23 Jun 2007 00:01:56 +0200
parents a85d51778eda
children a43db0817020
line wrap: on
line diff
--- a/MoinMoin/events/__init__.py	Fri Jun 22 19:00:44 2007 +0200
+++ b/MoinMoin/events/__init__.py	Sat Jun 23 00:01:56 2007 +0200
@@ -120,6 +120,10 @@
         Event.__init__(self, request)
         self.user = user
         
+class EventResult:
+    """ This is a base class for messages passed from event handlers """
+    pass
+        
 def get_handlers(cfg):
     """Create a list of available event handlers.
     
@@ -158,7 +162,7 @@
     # Try to handle the event with each available handler (for now)
     for handle in cfg.event_handlers:
         retval = handle(event)
-        if isinstance(retval, unicode):
+        if retval:
             msg.append(retval)
             
     return msg