view website/issues/detectors/messagesummary.py @ 5375:1ad46057ae4a

Test against latest version of Xapian The version of Xapian available in the Ubuntu 14.04 repositories doesn't support python3 (Xapian >=1.3 required). The xapian-backports PPA provides the latest version of Xapian (v1.4.7 at the time of this commit), which does have support for python3.
author John Kristensen <john@jerrykan.com>
date Sat, 21 Jul 2018 23:07:16 +1000
parents 6e3e4f24c753
children 0942fe89e82e
line wrap: on
line source

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'], config=db.config)
    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
#SHA: 538f90cb7f4eb63f77eca252b87afbe037d29c48

Roundup Issue Tracker: http://roundup-tracker.org/