From: richard Date: Thu, 13 Feb 2003 21:14:27 +0000 (+0000) Subject: oops, missing from yesterday's checkin X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b4b170675dbbcc617c108aacc7eca443e21e11bd;p=roundup.git oops, missing from yesterday's checkin git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1507 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/templates/classic/detectors/messagesummary.py b/roundup/templates/classic/detectors/messagesummary.py new file mode 100644 index 0000000..2b23475 --- /dev/null +++ b/roundup/templates/classic/detectors/messagesummary.py @@ -0,0 +1,19 @@ +#$Id: messagesummary.py,v 1.1 2003-02-13 21:14:27 richard Exp $ + +from roundup.mailgw import parseContent + +def summarygenerator(db, cl, nodeid, newvalues): + ''' If the message doesn't have a summary, make one for it. + ''' + if newvalues.has_key('summary') or not newvalues.has_key('content'): + return + + summary, content = parseContent(newvalues['content'], 1, 1) + newvalues['summary'] = summary + + +def init(db): + # fire before changes are made + db.msg.audit('create', summarygenerator) + +# vim: set filetype=python ts=4 sw=4 et si