Mercurial > p > roundup > code
annotate detectors/newissuecopy.py @ 4736:8a32d8223aa4
CHANGES.txt: Mention demo.py fixes
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Mon, 14 Jan 2013 18:26:09 +0300 |
| parents | 6b32e9dac625 |
| children | 39c9f69c3f31 |
| 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 |
