[Python-checkins] r52933 - tracker/instances/python-dev/detectors/config.ini tracker/instances/python-dev/detectors/tellteam.py

paul.dubois python-checkins at python.org
Wed Dec 6 20:57:12 CET 2006


Author: paul.dubois
Date: Wed Dec  6 20:57:11 2006
New Revision: 52933

Added:
   tracker/instances/python-dev/detectors/config.ini
   tracker/instances/python-dev/detectors/tellteam.py
Log:
Adds triage email for new issues. Triage address(es) set as a single or comma-delimited list in detectors/config.ini. Currently set just to mail Dubois for testing purposes.

Added: tracker/instances/python-dev/detectors/config.ini
==============================================================================
--- (empty file)
+++ tracker/instances/python-dev/detectors/config.ini	Wed Dec  6 20:57:11 2006
@@ -0,0 +1,3 @@
+[main]
+triage_email = pfdubois at gmail.com
+

Added: tracker/instances/python-dev/detectors/tellteam.py
==============================================================================
--- (empty file)
+++ tracker/instances/python-dev/detectors/tellteam.py	Wed Dec  6 20:57:11 2006
@@ -0,0 +1,27 @@
+from roundup import roundupdb
+
+def newissuetriage(db, cl, nodeid, oldvalues):
+    ''' Copy a message about new issues to a triage address, 
+        set in detectors/config.ini
+    '''
+    # so use all the messages in the create
+    change_note = cl.generateCreateNote(nodeid)
+
+    # send a copy to the nosy list
+    try:
+        triage_email = db.config.detectors['TRIAGE_EMAIL'].split(",")
+    except KeyError:
+        triage_email = []
+    if not triage_email:
+        return
+    for msgid in cl.get(nodeid, 'messages'):
+        try:
+            # note: last arg must be a list
+            cl.send_message(nodeid, msgid, change_note, triage_email)
+        except roundupdb.MessageSendError, message:
+            raise roundupdb.DetectorError, message
+
+def init(db):
+    db.issue.react('create', newissuetriage)
+
+# vim: set filetype=python ts=4 sw=4 et si


More information about the Python-checkins mailing list