diff detectors/newissuecopy.py @ 684:5b23ff865f3a

added a "detectors" directory... ...for people to put their useful auditors and reactors in. Note - the roundupdb.IssueClass.sendmessage method has been split and renamed "nosymessage" specifically for things like the nosy reactor, and "send_message" which just sends the message. The initial detector is one that we'll be using here at ekit - it bounces new issue messages to a team address.
author Richard Jones <richard@users.sourceforge.net>
date Mon, 08 Apr 2002 03:40:31 +0000
parents
children de6dc74a4148
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/detectors/newissuecopy.py	Mon Apr 08 03:40:31 2002 +0000
@@ -0,0 +1,20 @@
+# 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:
+            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)
+

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