File: newissuecopy.py

package info (click to toggle)
roundup 1.4.20-1.1%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 8,352 kB
  • sloc: python: 34,925; 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