[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1055452 - /subversion/trunk/tools/po/l10n-report.py

From: Branko ─îibej <brane_at_xbc.nu>
Date: Wed, 05 Jan 2011 15:30:21 +0100

On 05.01.2011 14:00, danielsh_at_apache.org wrote:
> Author: danielsh
> Date: Wed Jan 5 13:00:07 2011
> New Revision: 1055452
>
> URL: http://svn.apache.org/viewvc?rev=1055452&view=rev
> Log:
> Add some helpful headers to l10-report.py's output.
>
> * tools/po/l10n-report.py
> (svn:keywords): Set to 'all'.
> (_rev): New helper.
> (main): Include a couple of extra headers.
>
> Modified:
> subversion/trunk/tools/po/l10n-report.py (contents, props changed)
>
> Modified: subversion/trunk/tools/po/l10n-report.py
> URL: http://svn.apache.org/viewvc/subversion/trunk/tools/po/l10n-report.py?rev=1055452&r1=1055451&r2=1055452&view=diff
> ==============================================================================
> --- subversion/trunk/tools/po/l10n-report.py (original)
> +++ subversion/trunk/tools/po/l10n-report.py Wed Jan 5 13:00:07 2011
> @@ -1,5 +1,6 @@
> #!/usr/bin/env python
> #
> +# $Id$
> #
> # Licensed to the Apache Software Foundation (ASF) under one
> # or more contributor license agreements. See the NOTICE file
> @@ -39,6 +40,10 @@ import os
> import re
> import subprocess
>
> +def _rev():
> + dollar = "$Revision$"
> + return int(re.findall('[0-9]+', dollar)[0]);
> +
> def usage_and_exit(errmsg=None):
> """Print a usage message, plus an ERRMSG (if provided), then exit.
> If ERRMSG is provided, the usage message is printed to stderr and
> @@ -185,9 +190,16 @@ def main():
> email_to = "To: %s" % to_email_id
> email_sub = "Subject: [l10n] Translation status report for %s r%s" \
> % (branch_name, wc_version)
> + x_headers = "".join([
> + "X-Mailer: l10n-report.py r%ld\n" % _rev(),
> + "Reply-To: dev_at_subversion.apache.org\n",
> + "Mail-Followup-To: dev_at_subversion.apache.org\n",
> + # http://www.iana.org/assignments/auto-submitted-keywords/auto-submitted-keywords.xhtml
> + "Auto-Submitted: auto-generated\n",
> + ];
>
> - 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)
> + msg = "\n".join((email_from, email_to, email_sub, x_headers,
> + title, format_head, format_line, body))
>
> server.sendmail(email_from, email_to, msg)
> print("The report is sent to '%s' email id." % to_email_id)

RFC822 messages should properly have CRLF line endings, so I'd suggest
"\r\n".join(...) for both the headers and the body.

-- Brane
Received on 2011-01-05 15:31:01 CET

This is an archived mail posted to the Subversion Dev mailing list.