comparison MoinMoin/action/AttachFile.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 316bbfb37f2b
children 10be78f1fa97
comparison
equal deleted inserted replaced
2316:02824b69a95c 2318:062b76cf8d48
220 stream.close() 220 stream.close()
221 221
222 _addLogEntry(request, 'ATTNEW', pagename, target) 222 _addLogEntry(request, 'ATTNEW', pagename, target)
223 223
224 event = FileAttachedEvent(request, pagename, target, len(filecontent)) 224 event = FileAttachedEvent(request, pagename, target, len(filecontent))
225 messages = send_event(event) 225 results = events.send_event(event)
226 msg = "".join(messages) 226
227 recipients = []
228 for result in results:
229 if isinstance(results, notification.Success):
230 recipients.append(result.recipient)
231
232 if recipients:
233 info = _("Notifications sent to:")
234 msg = msg + "<p>%s %s</p>" % (info, ",".join(recipients))
227 235
228 if request.cfg.xapian_search: 236 if request.cfg.xapian_search:
229 from MoinMoin.search.Xapian import Index 237 from MoinMoin.search.Xapian import Index
230 index = Index(request) 238 index = Index(request)
231 if index.exists(): 239 if index.exists():