Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fefad3c

Browse files
committed
stylistic improvements
1 parent b4a55a8 commit fefad3c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

extra/shutils/regressiontest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
SMTP_PORT = 25
2727
SMTP_TIMEOUT = 30
2828
29+
2930
30-
SUBJECT = "Regression test results on %s using revision %s" % (TIME, REVISION)
31+
SUBJECT = "Regression test on %s using revision %s" % (TIME, REVISION)
3132

3233
def 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\nRegression test finished at %s" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime())
128128

129129
msg = prepare_email(content)
130130

0 commit comments

Comments
 (0)