mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 08:14:24 +03:00
stylistic improvements
This commit is contained in:
parent
b4a55a809e
commit
fefad3cba1
|
@ -26,8 +26,9 @@ SMTP_SERVER = "127.0.0.1"
|
||||||
SMTP_PORT = 25
|
SMTP_PORT = 25
|
||||||
SMTP_TIMEOUT = 30
|
SMTP_TIMEOUT = 30
|
||||||
FROM = "regressiontest@sqlmap.org"
|
FROM = "regressiontest@sqlmap.org"
|
||||||
|
#TO = "dev@sqlmap.org"
|
||||||
TO = ["bernardo.damele@gmail.com", "miroslav.stampar@gmail.com"]
|
TO = ["bernardo.damele@gmail.com", "miroslav.stampar@gmail.com"]
|
||||||
SUBJECT = "Regression test results on %s using revision %s" % (TIME, REVISION)
|
SUBJECT = "Regression test on %s using revision %s" % (TIME, REVISION)
|
||||||
|
|
||||||
def prepare_email(content):
|
def prepare_email(content):
|
||||||
global FROM
|
global FROM
|
||||||
|
@ -37,7 +38,7 @@ def prepare_email(content):
|
||||||
msg = MIMEMultipart()
|
msg = MIMEMultipart()
|
||||||
msg["Subject"] = SUBJECT
|
msg["Subject"] = SUBJECT
|
||||||
msg["From"] = FROM
|
msg["From"] = FROM
|
||||||
msg["To"] = ",".join(TO)
|
msg["To"] = TO if isinstance(TO, basestring) else ",".join(TO)
|
||||||
|
|
||||||
msg.attach(MIMEText(content))
|
msg.attach(MIMEText(content))
|
||||||
|
|
||||||
|
@ -50,7 +51,6 @@ def send_email(msg):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s = smtplib.SMTP(host=SMTP_SERVER, port=SMTP_PORT, timeout=SMTP_TIMEOUT)
|
s = smtplib.SMTP(host=SMTP_SERVER, port=SMTP_PORT, timeout=SMTP_TIMEOUT)
|
||||||
#s.set_debuglevel(1)
|
|
||||||
s.sendmail(FROM, TO, msg.as_string())
|
s.sendmail(FROM, TO, msg.as_string())
|
||||||
s.quit()
|
s.quit()
|
||||||
# Catch all for SMTP exceptions
|
# Catch all for SMTP exceptions
|
||||||
|
@ -123,8 +123,8 @@ def main():
|
||||||
content += "#######################################################################\n\n"
|
content += "#######################################################################\n\n"
|
||||||
|
|
||||||
if content:
|
if content:
|
||||||
|
content += "Regression test finished at %s" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime())
|
||||||
SUBJECT += " (%s)" % ", ".join("#%d" % count for count in test_counts)
|
SUBJECT += " (%s)" % ", ".join("#%d" % count for count in test_counts)
|
||||||
content += "\n\nRegression test finished at %s" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime())
|
|
||||||
|
|
||||||
msg = prepare_email(content)
|
msg = prepare_email(content)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user