Code

Fixed a backlog of bug reports, and worked on python 2.3 compatibility:
[roundup.git] / scripts / roundup-reminder
index b3a004209380268bd85b4365b6bee171faa3286f..733d233a8f4b4d0fb792009ef30b1ce01e613f7c 100755 (executable)
@@ -19,7 +19,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-# $Id: roundup-reminder,v 1.2 2002-05-09 02:52:56 richard Exp $
+# $Id: roundup-reminder,v 1.5 2003-02-06 05:43:49 richard Exp $
 
 '''
 Simple script that emails all users of a tracker with the issues that
@@ -32,7 +32,7 @@ Note: The instance that this script was designed for has a modified schema!
       You will want to modify this script to customise it for your own schema!
 '''
 
-import cStringIO, MimeWriter, smtplib
+import sys, cStringIO, MimeWriter, smtplib
 from roundup import instance, date
 
 # open the instance
@@ -73,14 +73,14 @@ for user_id in db.user.list():
     # generate the email message
     message = cStringIO.StringIO()
     writer = MimeWriter.MimeWriter(message)
-    writer.addheader('Subject', 'Your active %s issues'%db.config.INSTANCE_NAME)
+    writer.addheader('Subject', 'Your active %s issues'%db.config.TRACKER_NAME)
     writer.addheader('To', address)
-    writer.addheader('From', '%s <%s>'%(db.config.INSTANCE_NAME,
+    writer.addheader('From', '%s <%s>'%(db.config.TRACKER_NAME,
         db.config.ADMIN_EMAIL))
-    writer.addheader('Reply-To', '%s <%s>'%(db.config.INSTANCE_NAME,
+    writer.addheader('Reply-To', '%s <%s>'%(db.config.TRACKER_NAME,
         db.config.ADMIN_EMAIL))
     writer.addheader('MIME-Version', '1.0')
-    writer.addheader('X-Roundup-Name', db.config.INSTANCE_NAME)
+    writer.addheader('X-Roundup-Name', db.config.TRACKER_NAME)
 
     # start the multipart
     part = writer.startmultipartbody('alternative')
@@ -110,7 +110,7 @@ To view or respond to any of the issues listed above, visit the URL
    %s
 
 and click on "My Issues". Do NOT respond to this message.
-'''%db.config.ISSUE_TRACKER_WEB
+'''%db.config.TRACKER_WEB
 
 
     # now the HTML one
@@ -132,7 +132,7 @@ and click on "My Issues". Do NOT respond to this message.
             creation = creation_date.pretty()
         if not timeliness_id: timeliness_id = ' '
         title = db.issue.get(issue_id, 'title')
-        issue_id = '<a href="%sissue%s">%s</a>'%(db.config.ISSUE_TRACKER_WEB,
+        issue_id = '<a href="%sissue%s">%s</a>'%(db.config.TRACKER_WEB,
             issue_id, issue_id)
         colour = colours.get(timeliness, '')
         print >>body, '''<tr%s><td>%s</td><td>%s</td><td>%s</td>
@@ -150,12 +150,4 @@ and click on "My Issues". Do NOT respond to this message.
     smtp = smtplib.SMTP(db.config.MAILHOST)
     smtp.sendmail(db.config.ADMIN_EMAIL, address, message.getvalue())
 
-#
-# $Log: not supported by cvs2svn $
-# Revision 1.1  2002/04/15 06:37:31  richard
-# Here's a cron-job reminder script that we're going to be using here at
-# ekit. Might be useful for other people. Could use some work making it more
-# general and easier to customise.
-#
-#
-#
+# vim: set filetype=python ts=4 sw=4 et si