summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b9c31f)
raw | patch | inline | side by side (parent: 3b9c31f)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 8 Apr 2002 03:40:31 +0000 (03:40 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 8 Apr 2002 03:40:31 +0000 (03:40 +0000) |
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.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@697 57a73879-2fb5-44c3-a270-3262357dd7e2
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.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@697 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
detectors/newissuecopy.py | [new file with mode: 0644] | patch | blob |
doc/customizing.txt | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index fe640b13a82c0a1dd200486d94e9c93fd3d208fc..de2c49d05804cf26a3ed9bc68a0017e037611e95 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
2002-04-?? 0.4.2
Feature:
+ . 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.
. link() htmltemplate function now has a "showid" option for links and
multilinks. When true, it only displays the linked node id as the anchor
text. The link value is displayed as a tooltip using the title anchor
diff --git a/detectors/newissuecopy.py b/detectors/newissuecopy.py
--- /dev/null
@@ -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)
+
diff --git a/doc/customizing.txt b/doc/customizing.txt
index cf9f18a7aedfd7aea12535c321c3409b677d25f1..b2c97297d1fc2db9bb3cca50c8c10c1f42114485 100644 (file)
--- a/doc/customizing.txt
+++ b/doc/customizing.txt
Create a node in the database. This is generally used to create nodes in the
"definitional" classes like "priority" and "status".
+
+Detectors - adding behaviour to your tracker
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sample additional detectors that have been found useful will appear in the
+``detectors`` directory of the Roundup distribution:
+
+newissuecopy.py
+ This detector sends an email to a team address whenever a new issue is
+ created. The address is hard-coded into the detector, so edit it before you
+ use it (look for the text 'team@team.host') or you'll get email errors!
+
+
Web Interface
-------------
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 68a97e3372d1477c155e26fed122b2a3f0533c64..c9d2912816f4f0232340a8ffb573a86bad1f8723 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.49 2002-03-19 06:41:49 richard Exp $
+# $Id: roundupdb.py,v 1.50 2002-04-08 03:40:31 richard Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
appended to the "messages" field of the specified issue.
"""
- def sendmessage(self, nodeid, msgid, change_note):
+ def nosymessage(self, nodeid, msgid, change_note):
"""Send a message to the members of an issue's nosy list.
The message is sent only to users on the nosy list who are not
"""
users = self.db.user
messages = self.db.msg
- files = self.db.file
# figure the recipient ids
sendto = []
sendto.append(nosyid)
recipients.append(nosyid)
- # no new recipients
- if not sendto:
- return
+ # we have new recipients
+ if sendto:
+ # update the message's recipients list
+ messages.set(msgid, recipients=recipients)
+
+ # send the message
+ self.send_message(nodeid, msgid, change_note, sendto)
+
+ # XXX backwards compatibility - don't remove
+ sendmessage = nosymessage
+
+ def send_message(self, nodeid, msgid, note, sendto):
+ '''Actually send the nominated message from this node to the sendto
+ recipients, with the note appended.
+ '''
+ users = self.db.user
+ messages = self.db.msg
+ files = self.db.file
# determine the messageid and inreplyto of the message
inreplyto = messages.get(msgid, 'inreplyto')
messageid = messages.get(msgid, 'messageid')
+
+ # make up a messageid if there isn't one (web edit)
if not messageid:
# this is an old message that didn't get a messageid, so
# create one
self.classname, nodeid, self.db.config.MAIL_DOMAIN)
messages.set(msgid, messageid=messageid)
- # update the message's recipients list
- messages.set(msgid, recipients=recipients)
+ # figure the author's id
+ authid = messages.get(msgid, 'author')
# send an email to the people who missed out
sendto = [users.get(i, 'address') for i in sendto]
m.append(messages.get(msgid, 'content'))
# add the change note
- if change_note:
- m.append(change_note)
+ if note:
+ m.append(note)
# put in roundup's signature
if self.db.config.EMAIL_SIGNATURE_POSITION == 'bottom':
#
# $Log: not supported by cvs2svn $
+# Revision 1.49 2002/03/19 06:41:49 richard
+# Faster, easier, less mess ;)
+#
# Revision 1.48 2002/03/18 18:32:00 rochecompaan
# All messages sent to the nosy list are now encoded as quoted-printable.
#