paul@2 | 1 | #$Id: messagesummary.py,v 1.2 2007-04-03 06:47:21 a1s Exp $ |
paul@2 | 2 | |
paul@2 | 3 | from roundup.mailgw import parseContent |
paul@2 | 4 | |
paul@2 | 5 | def summarygenerator(db, cl, nodeid, newvalues): |
paul@2 | 6 | ''' If the message doesn't have a summary, make one for it. |
paul@2 | 7 | ''' |
paul@2 | 8 | if newvalues.has_key('summary') or not newvalues.has_key('content'): |
paul@2 | 9 | return |
paul@2 | 10 | |
paul@2 | 11 | summary, content = parseContent(newvalues['content'], config=db.config) |
paul@2 | 12 | newvalues['summary'] = summary |
paul@2 | 13 | |
paul@2 | 14 | |
paul@2 | 15 | def init(db): |
paul@2 | 16 | # fire before changes are made |
paul@2 | 17 | db.msg.audit('create', summarygenerator) |
paul@2 | 18 | |
paul@2 | 19 | # vim: set filetype=python ts=4 sw=4 et si |