summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77ccc0a)
raw | patch | inline | side by side (parent: 77ccc0a)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 11 Feb 2004 00:00:01 +0000 (00:00 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 11 Feb 2004 00:00:01 +0000 (00:00 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2067 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
scripts/roundup-reminder | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 42952753366d35e515ad7ea005192de9045e3e0f..d7d1620367a354af9a6cf7c51700f10a572ac596 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- fixed check for JS pop()/push() to make more general (sf bug 877504)
- fix re-enabling queries (sf bug 861940)
- use supplied content-type on file uploads before trying filename)
+- fixed roundup-reminder script to use default schema (thanks Klamer Schutte)
2003-12-17 0.6.4
index 922fe62d52bfe371216f2bb3688cc2ebefdd7804..a4db8fce3a9e02806291db3b0cdaf4cbc4f5e30a 100755 (executable)
--- a/scripts/roundup-reminder
+++ b/scripts/roundup-reminder
-#! /usr/bin/env python
+#! /usr/bin/env python2.2
# Copyright (c) 2002 ekit.com Inc (http://www.ekit-inc.com/)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-# $Id: roundup-reminder,v 1.6 2003-04-24 07:19:59 richard Exp $
+# $Id: roundup-reminder,v 1.7 2004-02-11 00:00:01 richard Exp $
'''
Simple script that emails all users of a tracker with the issues that
TODO: introduce some structure ;)
TODO: possibly make this more general and configurable...
-
-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 sys, cStringIO, MimeWriter, smtplib
resolved_id = db.status.lookup('resolved')
+def listCompare(x, y):
+ "compare two tuples such that order is positive on [0] and negative on [1]"
+ if x[0] < y[0]:
+ return -1
+ if x[0] > y[0]:
+ return 1
+ if x[1] > y[1]:
+ return -1
+ if x[1] < y[1]:
+ return 1
+ return 0
+
# loop through all the users
for user_id in db.user.list():
# make sure we care aboue this user
# extract this user's issues
l = []
for issue_id in db.issue.find(assignedto=user_id):
- if db.issue.get(issue_id, 'status') == resolved_id: continue
- timeliness_id = db.issue.get(issue_id, 'timeliness')
- if timeliness_id:
- timeliness = db.timeliness.get(timeliness_id, 'name')
- else:
- timeliness = '~~~'
- l.append((timeliness, db.issue.get(issue_id, 'creation'), issue_id))
+ if db.issue.get(issue_id, 'status') == resolved_id:
+ continue
+ order = db.priority.get(db.issue.get(issue_id, 'priority'), 'order')
+ l.append((order, db.issue.get(issue_id, 'activity'),
+ db.issue.get(issue_id, 'creation'), issue_id))
# sort the issues by timeliness and creation date
- l.sort()
+ l.sort(listCompare)
if not l:
continue
print >>body, 'Created ID Urgency Title'
print >>body, '='*75
# '2 months 213 immediate cc_daemon barfage
- for timeliness, creation_date, issue_id in l:
+ old_priority = None
+ for priority_order, activity_date, creation_date, issue_id in l:
+ priority = db.issue.get(issue_id, 'priority')
+ if (priority != old_priority):
+ old_priority = priority
+ print >>body, ' ', db.priority.get(priority,'name')
# pretty creation
creation = (date.Date('.') - creation_date).pretty()
if creation is None:
creation = creation_date.pretty()
-
- if not timeliness: timeliness = ''
+ activity = (date.Date('.') - activity_date).pretty()
title = db.issue.get(issue_id, 'title')
- if len(title) > 52: title = title[:48] + ' ...'
- print >>body, '%-11s %-4s %-9s %-52s'%(creation, issue_id,
- timeliness, title)
+ if len(title) > 42:
+ title = title[:38] + ' ...'
+ print >>body, '%-11s %-4s %-9s %-42s'%(creation, issue_id,
+ activity, title)
# some help to finish off
print >>body, '''
'whenever': ' bgcolor="#ffffff"',
}
print >>body, '''<table border>
-<tr><th>Created</th> <th>ID</th> <th>Urgency</th> <th>Title</th></tr>
+<tr><th>Created</th> <th>ID</th> <th>Activity</th> <th>Title</th></tr>
'''
- for timeliness, creation_date, issue_id in l:
+ old_priority = None
+ for priority_order, activity_date, creation_date, issue_id in l:
+ priority = db.issue.get(issue_id,'priority')
+ if (priority != old_priority):
+ old_priority = priority
+ print >>body, '<tr><td>-></td><td>-></td><td>-></td><td><b>%s</b></td></tr>'%db.priority.get(priority,'name')
creation = (date.Date('.') - creation_date).pretty()
if creation is None:
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.TRACKER_WEB,
issue_id, issue_id)
- colour = colours.get(timeliness, '')
- print >>body, '''<tr%s><td>%s</td><td>%s</td><td>%s</td>
- <td>%s</td></tr>'''%(colour, creation, issue_id, timeliness, title)
+ activity = (date.Date('.') - activity_date).pretty()
+ print >>body, '''<tr><td>%s</td><td>%s</td><td>%s</td>
+ <td>%s</td></tr>'''%(creation, issue_id, activity, title)
print >>body, '</table>'
print >>body, '''<p>To view or respond to any of the issues listed