Mercurial > p > roundup > code
diff roundup/mailer.py @ 3548:61d48244e7a8
login may now be for a single session
trackers may hide exceptions from web users (they will be mailed to the
tracker admin)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 08 Feb 2006 03:47:28 +0000 |
| parents | f43424d545a6 |
| children | 3954fbcefae5 |
line wrap: on
line diff
--- a/roundup/mailer.py Tue Feb 07 04:59:05 2006 +0000 +++ b/roundup/mailer.py Wed Feb 08 03:47:28 2006 +0000 @@ -1,9 +1,9 @@ """Sending Roundup-specific mail over SMTP. """ __docformat__ = 'restructuredtext' -# $Id: mailer.py,v 1.14 2006-02-02 04:14:29 richard Exp $ +# $Id: mailer.py,v 1.15 2006-02-08 03:47:28 richard Exp $ -import time, quopri, os, socket, smtplib, re +import time, quopri, os, socket, smtplib, re, sys, traceback from cStringIO import StringIO from MimeWriter import MimeWriter @@ -143,6 +143,15 @@ self.smtp_send(to, message) + def exception_message(self): + '''Send a message to the admins with information about the latest + traceback. + ''' + subject = '%s: %s'%(self.config.TRACKER_NAME, sys.exc_info()[1]) + to = [self.config.ADMIN_EMAIL] + content = traceback.format_exc() + self.standard_message(to, subject, content) + def smtp_send(self, to, message): """Send a message over SMTP, using roundup's config.
