Author: hwright
Date: Wed Dec 29 14:39:17 2010
New Revision: 1053645
URL: http://svn.apache.org/viewvc?rev=1053645&view=rev
Log:
Reduce the external dependencies when sending mail from a helper script.
* tools/po/l10n-report.py
(main): Use the smtp library for sending mail, rather than shelling out
to 'sendmail'.
Modified:
subversion/trunk/tools/po/l10n-report.py
Modified: subversion/trunk/tools/po/l10n-report.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/po/l10n-report.py?rev=1053645&r1=1053644&r2=1053645&view=diff
==============================================================================
--- subversion/trunk/tools/po/l10n-report.py (original)
+++ subversion/trunk/tools/po/l10n-report.py Wed Dec 29 14:39:17 2010
@@ -178,6 +178,9 @@ def main():
print(po_format)
if to_email_id:
+ import smtplib
+
+ server = smtplib.SMTP('localhost')
email_from = "From: SVN DEV <[email protected]>"
email_to = "To: %s" % to_email_id
email_sub = "Subject: [l10n] Translation status report for %s r%s" \
@@ -186,8 +189,7 @@ def main():
msg = "%s\n%s\n%s\n%s\n%s\n%s\n%s" % (email_from, email_to,\
email_sub, title, format_head, format_line, body)
- cmd = ['sendmail', '-t']
- l10n.safe_command(cmd, msg)
+ server.sendmail(email_from, email_to, msg)
print("The report is sent to '%s' email id." % to_email_id)
else:
print("\nYou have not passed '-m' option, so email is not sent.")