Skip to content

Commit 1b714d8

Browse files
author
Richard Jones
committed
Added author identification to e-mail messages from roundup.
1 parent 005c44c commit 1b714d8

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

roundup-admin

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup-admin,v 1.35 2001-10-20 11:58:48 richard Exp $
19+
# $Id: roundup-admin,v 1.36 2001-10-21 00:45:15 richard Exp $
2020

2121
import sys
2222
if int(sys.version[0]) < 2:
@@ -610,7 +610,7 @@ Command help:
610610

611611
# do the command
612612
try:
613-
return function(args[1:])
613+
return function(self, args[1:])
614614
finally:
615615
self.db.close()
616616

@@ -671,6 +671,10 @@ if __name__ == '__main__':
671671

672672
#
673673
# $Log: not supported by cvs2svn $
674+
# Revision 1.35 2001/10/20 11:58:48 richard
675+
# Catch errors in login - no username or password supplied.
676+
# Fixed editing of password (Password property type) thanks Roch'e Compaan.
677+
#
674678
# Revision 1.34 2001/10/18 02:16:42 richard
675679
# Oops, committed the admin script with the wierd #! line.
676680
# Also, made the thing into a class to reduce parameter passing.

roundup/roundupdb.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: roundupdb.py,v 1.12 2001-10-04 02:16:15 richard Exp $
18+
# $Id: roundupdb.py,v 1.13 2001-10-21 00:45:15 richard Exp $
1919

2020
import re, os, smtplib, socket
2121

@@ -262,13 +262,27 @@ def sendmessage(self, nodeid, msgid):
262262
sendto = [self.db.user.get(i, 'address') for i in recipients]
263263
cn = self.classname
264264
title = self.get(nodeid, 'title') or '%s message copy'%cn
265+
# figure author information
266+
authname = self.db.user.get(authid, 'realname')
267+
if not authname:
268+
authname = self.db.user.get(authid, 'username')
269+
authaddr = self.db.user.get(authid, 'address')
270+
if authaddr:
271+
authaddr = '<%s> '%authaddr
272+
else:
273+
authaddr = ''
274+
# TODO attachments
265275
m = ['Subject: [%s%s] %s'%(cn, nodeid, title)]
266276
m.append('To: %s'%', '.join(sendto))
267277
m.append('Reply-To: %s'%self.ISSUE_TRACKER_EMAIL)
268278
m.append('')
279+
# add author information
280+
m.append("%s %sadded the comment:"%(authname, authaddr))
281+
m.append('')
282+
# add the content
269283
m.append(self.db.msg.get(msgid, 'content'))
284+
# "list information" footer
270285
m.append(self.email_footer(nodeid, msgid))
271-
# TODO attachments
272286
try:
273287
smtp = smtplib.SMTP(self.MAILHOST)
274288
smtp.sendmail(self.ISSUE_TRACKER_EMAIL, sendto, '\n'.join(m))
@@ -289,6 +303,9 @@ def email_footer(self, nodeid, msgid):
289303

290304
#
291305
# $Log: not supported by cvs2svn $
306+
# Revision 1.12 2001/10/04 02:16:15 richard
307+
# Forgot to pass the protected flag down *sigh*.
308+
#
292309
# Revision 1.11 2001/10/04 02:12:42 richard
293310
# Added nicer command-line item adding: passing no arguments will enter an
294311
# interactive more which asks for each property in turn. While I was at it, I

0 commit comments

Comments
 (0)