File: newissuecopy.py

package info (click to toggle)
roundup 1.4.20-1.1
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 8,312 kB
  • sloc: python: 34,917; sh: 353; perl: 23; makefile: 19
file content (22 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# copied from nosyreaction

from roundup import roundupdb

def newissuecopy(db, cl, nodeid, oldvalues):
    ''' Copy a message about new issues to a team address.
    '''
    # so use all the messages in the create
    change_note = cl.generateCreateNote(nodeid)

    # send a copy to the nosy list
    for msgid in cl.get(nodeid, 'messages'):
        try:
            # note: last arg must be a list
            cl.send_message(nodeid, msgid, change_note, ['team@team.host'])
        except roundupdb.MessageSendError, message:
            raise roundupdb.DetectorError, message

def init(db):
    db.issue.react('create', newissuecopy)

# vim: set filetype=python ts=4 sw=4 et si