diff MoinMoin/events/__init__.py @ 5279:2aa43685e17b

AttachFile: added remove_attachment(), made nuke_page use it (details below) AttachFile was missing a remove_attachment function (in the style of add_attachment), added it. It triggers an event FileRemovedEvent. FileRemovedEvent handling: * implemented for mail notifications * implemented for xapian index updates * not implemented for jabber notifications (this also needs some work in the jabber bot + testing) nuke_page was broken because it did not remove attachments from xapian index, fixed it by using remove_attachment (which triggers indexing via FileRemovedEvent).
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 15 Nov 2009 10:08:13 +0100
parents 92d08c1975b0
children d25574af97eb
line wrap: on
line diff
--- a/MoinMoin/events/__init__.py	Sat Nov 14 13:57:18 2009 +0100
+++ b/MoinMoin/events/__init__.py	Sun Nov 15 10:08:13 2009 +0100
@@ -119,6 +119,20 @@
         self.size = size
 
 
+class FileRemovedEvent(PageEvent):
+
+    name = u"FileRemovedEvent"
+    description = _(u"""An attachment has been removed""")
+    req_superuser = False
+
+    def __init__(self, request, pagename, filename, size):
+        PageEvent.__init__(self, request)
+        self.request = request
+        self.pagename = pagename
+        self.filename = filename
+        self.size = size
+
+
 class PageRevertedEvent(PageEvent):
 
     name = u"PageRevertedEvent"