fixfile(): Do the mailto: hacking on both the Author: and

Discussions-To: headers.  Also, apply SF patch #410223 by Andrew
Kuchling, which does the PEP# href wrapping for Replaces: and
Replaced-By: headers.
This commit is contained in:
Barry Warsaw 2001-03-21 17:26:05 +00:00
parent 33edbc7212
commit 3e471ac10a
1 changed files with 7 additions and 1 deletions

View File

@ -123,7 +123,7 @@ def fixfile(infile, outfile):
fo.write('</div>\n'
'<div class="header">\n<table border="0">\n')
for k, v in header:
if k.lower() == 'author':
if k.lower() in ('author', 'discussions-to'):
mailtos = []
for addr in v.split():
if '@' in addr:
@ -133,6 +133,12 @@ def fixfile(infile, outfile):
else:
mailtos.append(addr)
v = ' '.join(mailtos)
elif k.lower() in ('replaces', 'replaced-by'):
peps = ''
for pep in v.split():
pep = int(pep)
peps += '<a href="pep-%04d.html">%i</a> ' % (pep, pep)
v = peps
else:
v = cgi.escape(v)
fo.write(" <tr><th align='right'>%s:</th><td>%s</td></tr>\n"