From 4cae039a4733434feacec437b3adb590dd444e62 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 21 Oct 2001 00:45:15 +0000 Subject: [PATCH] Added author identification to e-mail messages from roundup. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@318 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup-admin | 8 ++++++-- roundup/roundupdb.py | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/roundup-admin b/roundup-admin index ff200d0..176ab71 100755 --- a/roundup-admin +++ b/roundup-admin @@ -16,7 +16,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup-admin,v 1.35 2001-10-20 11:58:48 richard Exp $ +# $Id: roundup-admin,v 1.36 2001-10-21 00:45:15 richard Exp $ import sys if int(sys.version[0]) < 2: @@ -610,7 +610,7 @@ Command help: # do the command try: - return function(args[1:]) + return function(self, args[1:]) finally: self.db.close() @@ -671,6 +671,10 @@ if __name__ == '__main__': # # $Log: not supported by cvs2svn $ +# Revision 1.35 2001/10/20 11:58:48 richard +# Catch errors in login - no username or password supplied. +# Fixed editing of password (Password property type) thanks Roch'e Compaan. +# # Revision 1.34 2001/10/18 02:16:42 richard # Oops, committed the admin script with the wierd #! line. # Also, made the thing into a class to reduce parameter passing. diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py index 599d188..d70404c 100644 --- a/roundup/roundupdb.py +++ b/roundup/roundupdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.12 2001-10-04 02:16:15 richard Exp $ +# $Id: roundupdb.py,v 1.13 2001-10-21 00:45:15 richard Exp $ import re, os, smtplib, socket @@ -262,13 +262,27 @@ class IssueClass(Class): sendto = [self.db.user.get(i, 'address') for i in recipients] cn = self.classname title = self.get(nodeid, 'title') or '%s message copy'%cn + # figure author information + authname = self.db.user.get(authid, 'realname') + if not authname: + authname = self.db.user.get(authid, 'username') + authaddr = self.db.user.get(authid, 'address') + if authaddr: + authaddr = '<%s> '%authaddr + else: + authaddr = '' + # TODO attachments m = ['Subject: [%s%s] %s'%(cn, nodeid, title)] m.append('To: %s'%', '.join(sendto)) m.append('Reply-To: %s'%self.ISSUE_TRACKER_EMAIL) m.append('') + # add author information + m.append("%s %sadded the comment:"%(authname, authaddr)) + m.append('') + # add the content m.append(self.db.msg.get(msgid, 'content')) + # "list information" footer m.append(self.email_footer(nodeid, msgid)) - # TODO attachments try: smtp = smtplib.SMTP(self.MAILHOST) smtp.sendmail(self.ISSUE_TRACKER_EMAIL, sendto, '\n'.join(m)) @@ -289,6 +303,9 @@ Roundup issue tracker # # $Log: not supported by cvs2svn $ +# Revision 1.12 2001/10/04 02:16:15 richard +# Forgot to pass the protected flag down *sigh*. +# # Revision 1.11 2001/10/04 02:12:42 richard # Added nicer command-line item adding: passing no arguments will enter an # interactive more which asks for each property in turn. While I was at it, I -- 2.30.2