annotate detectors/newissuecopy.py @ 4754:4e16bcd4405e

Generate some Chomsky issues
author Pradip Caulagi <caulagi@gmail.com>
date Sun, 03 Feb 2013 17:29:32 +0530
parents 6b32e9dac625
children 39c9f69c3f31
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4627
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
1 # copied from nosyreaction
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
2
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
3 from roundup import roundupdb
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
4
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
5 def newissuecopy(db, cl, nodeid, oldvalues):
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
6 ''' Copy a message about new issues to a team address.
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
7 '''
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
8 # so use all the messages in the create
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
9 change_note = cl.generateCreateNote(nodeid)
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
10
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
11 # send a copy to the nosy list
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
12 for msgid in cl.get(nodeid, 'messages'):
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
13 try:
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
14 # note: last arg must be a list
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
15 cl.send_message(nodeid, msgid, change_note, ['team@team.host'])
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
16 except roundupdb.MessageSendError, message:
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
17 raise roundupdb.DetectorError, message
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
18
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
19 def init(db):
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
20 db.issue.react('create', newissuecopy)
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
21
6b32e9dac625 Restore sample detectors removed by 07c5d833dcb2 (issue2550574)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
22 # vim: set filetype=python ts=4 sw=4 et si

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