[Python-checkins] CVS: python/nondist/peps pep2html.py,1.21,1.22

Barry Warsaw bwarsaw@users.sourceforge.net
Wed, 21 Mar 2001 09:26:07 -0800


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv8471

Modified Files:
	pep2html.py 
Log Message:
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.


Index: pep2html.py
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** pep2html.py	2001/03/21 14:52:13	1.21
--- pep2html.py	2001/03/21 17:26:05	1.22
***************
*** 124,128 ****
               '<div class="header">\n<table border="0">\n')
      for k, v in header:
!         if k.lower() == 'author':
              mailtos = []
              for addr in v.split():
--- 124,128 ----
               '<div class="header">\n<table border="0">\n')
      for k, v in header:
!         if k.lower() in ('author', 'discussions-to'):
              mailtos = []
              for addr in v.split():
***************
*** 134,137 ****
--- 134,143 ----
                      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)