diff MoinMoin/events/__init__.py @ 2385:53fbdf5899ff

Use the event handling framework to (re)generate xapian indexes.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sat, 14 Jul 2007 18:42:12 +0200
parents 1d60f9aa07d1
children cf85b6916d17
line wrap: on
line diff
--- a/MoinMoin/events/__init__.py	Sat Jul 14 18:41:44 2007 +0200
+++ b/MoinMoin/events/__init__.py	Sat Jul 14 18:42:12 2007 +0200
@@ -67,11 +67,22 @@
 
     def __init__(self, request, page, comment):
         PageEvent.__init__(self, request)
-        self.request = request
         self.page = page
         self.comment = comment
 
 
+class PageCopiedEvent(PageEvent):
+
+    description = u"""Page has been copied"""
+    req_superuser = False
+
+    def __init__(self, request, page, old_page, comment):
+        PageEvent.__init__(self, request)
+        self.page = page
+        self.old_page = old_page
+        self.comment = comment
+
+
 class FileAttachedEvent(PageEvent):
 
     description = u"""A new attachment has been added"""
@@ -178,6 +189,9 @@
     # Try to handle the event with each available handler (for now)
     for handle in cfg.event_handlers:
         retval = handle(event)
+
+        assert retval is None or isinstance(retval, EventResult)
+
         if retval:
             msg.append(retval)