[Python-checkins] peps: Linkify the Author: fields with mailto urls.
georg.brandl
python-checkins at python.org
Wed Mar 23 21:25:16 CET 2011
http://hg.python.org/peps/rev/7cf39e997171
changeset: 110:7cf39e997171
user: Barry Warsaw <barry at python.org>
date: Thu Aug 17 04:27:04 2000 +0000
summary:
Linkify the Author: fields with mailto urls.
files:
pep2html.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/pep2html.py b/pep2html.py
--- a/pep2html.py
+++ b/pep2html.py
@@ -108,8 +108,20 @@
fo.write('</div>\n'
'<div class="header">\n<table border="0">\n')
for k, v in header:
+ if k.lower() == 'author':
+ mailtos = []
+ for addr in v.split():
+ if '@' in addr:
+ mailtos.append(
+ '<a href="mailto:%s?subject=PEP%%20%s">%s</a>' %
+ (addr, pep, addr))
+ else:
+ mailtos.append(addr)
+ v = ' '.join(mailtos)
+ else:
+ v = cgi.escape(v)
fo.write(" <tr><th align='right'>%s:</th><td>%s</td></tr>\n"
- % (cgi.escape(k), cgi.escape(v)))
+ % (cgi.escape(k), v))
title = 0
fo.write("</table>\n</div>\n<hr />\n"
"<pre>")
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list