1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: roundupdb.py,v 1.24 2001-11-30 11:29:04 rochecompaan Exp $
18+ # $Id: roundupdb.py,v 1.25 2001-11-30 20:28:10 rochecompaan Exp $
1919
2020__doc__ = """
2121Extending hyperdb with types specific to issue-tracking.
@@ -310,8 +310,19 @@ def sendmessage(self, nodeid, msgid, oldvalues):
310310 if rlen == len (recipients ):
311311 return
312312
313+ # get the change note
314+ if oldvalues :
315+ change_note = self .generateChangeNote (nodeid , oldvalues )
316+ else :
317+ change_note = ''
318+
319+ # add the change note to the message content
320+ content = self .db .msg .get (msgid , 'content' )
321+ content += change_note
322+
313323 # update the message's recipients list
314324 self .db .msg .set (msgid , recipients = recipients )
325+ self .db .msg .setcontent ('msg' , msgid , content )
315326
316327 # send an email to the people who missed out
317328 sendto = [self .db .user .get (i , 'address' ) for i in recipients ]
@@ -327,18 +338,12 @@ def sendmessage(self, nodeid, msgid, oldvalues):
327338 else :
328339 authaddr = ''
329340
330- # get the change note
331- if oldvalues :
332- change_note = self .generateChangeNote (nodeid , oldvalues )
333- else :
334- change_note = ''
335-
336341 # make the message body
337342 m = ['' ]
338343
339344 # put in roundup's signature
340345 if self .EMAIL_SIGNATURE_POSITION == 'top' :
341- m .append (self .email_signature (nodeid , msgid , change_note ))
346+ m .append (self .email_signature (nodeid , msgid ))
342347
343348 # add author information
344349 if oldvalues :
@@ -348,11 +353,11 @@ def sendmessage(self, nodeid, msgid, oldvalues):
348353 m .append ('' )
349354
350355 # add the content
351- m .append (self . db . msg . get ( msgid , ' content' ) )
356+ m .append (content )
352357
353358 # put in roundup's signature
354359 if self .EMAIL_SIGNATURE_POSITION == 'bottom' :
355- m .append (self .email_signature (nodeid , msgid , change_note ))
360+ m .append (self .email_signature (nodeid , msgid ))
356361
357362 # get the files for this message
358363 files = self .db .msg .get (msgid , 'files' )
@@ -364,7 +369,7 @@ def sendmessage(self, nodeid, msgid, oldvalues):
364369 writer .addheader ('To' , ', ' .join (sendto ))
365370 writer .addheader ('From' , '%s <%s>' % (self .INSTANCE_NAME ,
366371 self .ISSUE_TRACKER_EMAIL ))
367- writer .addheader ('Reply-To: ' , '%s <%s>' % (self .INSTANCE_NAME ,
372+ writer .addheader ('Reply-To' , '%s <%s>' % (self .INSTANCE_NAME ,
368373 self .ISSUE_TRACKER_EMAIL ))
369374 writer .addheader ('MIME-Version' , '1.0' )
370375
@@ -413,13 +418,13 @@ def sendmessage(self, nodeid, msgid, oldvalues):
413418 raise MessageSendError , \
414419 "Couldn't send confirmation email: %s" % value
415420
416- def email_signature (self , nodeid , msgid , change_note ):
421+ def email_signature (self , nodeid , msgid ):
417422 ''' Add a signature to the e-mail with some useful information
418423 '''
419424 web = self .ISSUE_TRACKER_WEB + 'issue' + nodeid
420425 email = '"%s" <%s>' % (self .INSTANCE_NAME , self .ISSUE_TRACKER_EMAIL )
421426 line = '_' * max (len (web ), len (email ))
422- return '%s\n %s\n %s\n %s\n %s ' % (line , email , web , change_note , line )
427+ return '%s\n %s\n %s\n %s' % (line , email , web , line )
423428
424429 def generateChangeNote (self , nodeid , oldvalues ):
425430 """Generate a change note that lists property changes
@@ -446,7 +451,7 @@ def generateChangeNote(self, nodeid, oldvalues):
446451 changed [key ] = old_value
447452
448453 # list the changes
449- m = []
454+ m = ['' , '----------' ]
450455 for propname , oldvalue in changed .items ():
451456 prop = cl .properties [propname ]
452457 value = cl .get (nodeid , propname , None )
@@ -465,6 +470,7 @@ def generateChangeNote(self, nodeid, oldvalues):
465470 oldvalue = ''
466471 change = '%s -> %s' % (oldvalue , value )
467472 elif isinstance (prop , hyperdb .Multilink ):
473+ change = ''
468474 if value is None : value = []
469475 l = []
470476 link = self .db .classes [prop .classname ]
@@ -488,12 +494,15 @@ def generateChangeNote(self, nodeid, oldvalues):
488494 else :
489495 l .append (entry )
490496 if l :
491- change = change + ' -%s' % (', ' .join (l ))
497+ change += ' -%s' % (', ' .join (l ))
492498 m .append ('%s: %s' % (propname , change ))
493499 return '\n ' .join (m )
494500
495501#
496502# $Log: not supported by cvs2svn $
503+ # Revision 1.24 2001/11/30 11:29:04 rochecompaan
504+ # Property changes are now listed in emails generated by Roundup
505+ #
497506# Revision 1.23 2001/11/27 03:17:13 richard
498507# oops
499508#
0 commit comments