web/hosts/issues/detectors newissues.py,NONE,1.1 Makefile.in,1.2,1.3 __init__.py,1.1,1.2

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.video.fresco.cvs
Message-ID <[email protected]>
Update of /cvs/fresco/web/hosts/issues/detectors
In directory purcel:/tmp/cvs-serv25280

Modified Files:
	Makefile.in __init__.py 
Added Files:
	newissues.py 
Log Message:
new-issue-notification reactor

--- NEW FILE: newissues.py ---
from roundup import roundupdb, hyperdb

def notify(db, cl, nodeid, values):
    ''' Notify users who want to get informed about new submissions'''

    # so use all the messages in the create
    change_note = cl.generateCreateNote(nodeid)

    # determine all users to notify
    components = cl.get(nodeid, 'components')
    users = []
    for u in db.user.list():
        for c in components:
            if c in db.user.get(u, 'notify_on_new_issues'):
                users.append(db.user.get(u, 'address'))
                break

    # send a copy to all interested users
    for msgid in cl.get(nodeid, 'messages'):
        try:
            # note: last arg must be a list
            cl.send_message(nodeid, msgid, change_note, users)
        except roundupdb.MessageSendError, message:
            raise roundupdb.DetectorError, message

def init(db):
    db.bug.react('create', notify)
    db.task.react('create', notify)
    db.milestone.react('create', notify)

Index: Makefile.in
===================================================================
RCS file: /cvs/fresco/web/hosts/issues/detectors/Makefile.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile.in	23 Oct 2002 02:12:15 -0000	1.2
+++ Makefile.in	14 Jan 2003 03:38:35 -0000	1.3
@@ -2,7 +2,7 @@
 
 include ../../../config.mk
 
-detectors	:= nosyreaction.py statusauditor.py __init__.py
+detectors	:= nosyreaction.py statusauditor.py newissues.py __init__.py
 
 all:
 

Index: __init__.py
===================================================================
RCS file: /cvs/fresco/web/hosts/issues/detectors/__init__.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- __init__.py	13 Oct 2002 17:06:12 -0000	1.1
+++ __init__.py	14 Jan 2003 03:38:35 -0000	1.2
@@ -1,22 +1,3 @@
-#
-# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
-# This module is free software, and you may redistribute it and/or modify
-# under the same terms as Python, so long as this copyright message and
-# disclaimer are retained in their original form.
-#
-# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
-# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
-# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
-# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
-# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
-# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-# 
-#$Id$
-
 def init(db):
     ''' execute the init functions of all the modules in this directory
     '''
@@ -33,5 +14,3 @@
     finally:
         del sys.path[0]
 
-# vim: set filetype=python ts=4 sw=4 et si
-#SHA: 4266d40eb7a75e6a75f20506e721ebd1644a3c9d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.