2626SMTP_PORT = 25
2727SMTP_TIMEOUT = 30
282829+ 293030- SUBJECT = "Regression test results on %s using revision %s" % (TIME , REVISION )
31+ SUBJECT = "Regression test on %s using revision %s" % (TIME , REVISION )
3132
3233def prepare_email (content ):
3334 global FROM
@@ -37,7 +38,7 @@ def prepare_email(content):
3738 msg = MIMEMultipart ()
3839 msg ["Subject" ] = SUBJECT
3940 msg ["From" ] = FROM
40- msg ["To" ] = "," .join (TO )
41+ msg ["To" ] = TO if isinstance ( TO , basestring ) else "," .join (TO )
4142
4243 msg .attach (MIMEText (content ))
4344
@@ -50,7 +51,6 @@ def send_email(msg):
5051
5152 try :
5253 s = smtplib .SMTP (host = SMTP_SERVER , port = SMTP_PORT , timeout = SMTP_TIMEOUT )
53- #s.set_debuglevel(1)
5454 s .sendmail (FROM , TO , msg .as_string ())
5555 s .quit ()
5656 # Catch all for SMTP exceptions
@@ -123,8 +123,8 @@ def main():
123123 content += "#######################################################################\n \n "
124124
125125 if content :
126+ content += "Regression test finished at %s" % time .strftime ("%H:%M:%S %d-%m-%Y" , time .gmtime ())
126127 SUBJECT += " (%s)" % ", " .join ("#%d" % count for count in test_counts )
127- content += "\n \n Regression test finished at %s" % time .strftime ("%H:%M:%S %d-%m-%Y" , time .gmtime ())
128128
129129 msg = prepare_email (content )
130130
0 commit comments