[Python-checkins] CVS: python/nondist/peps pep2html.py,1.19,1.20

Moshe Zadka moshez@users.sourceforge.net
Wed, 21 Mar 2001 04:37:25 -0800


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

Modified Files:
	pep2html.py 
Log Message:
Add hyperlinking of RFC mentions (Idea and link stolen from pydoc.py) 


Index: pep2html.py
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** pep2html.py	2001/03/20 15:07:21	1.19
--- pep2html.py	2001/03/21 12:37:22	1.20
***************
*** 47,51 ****
         '                      "http://www.w3.org/TR/REC-html40/loose.dtd">')
  
! fixpat = re.compile("((http|ftp):[-_a-zA-Z0-9/.+~:?#$=&]+)|(pep-\d+(.txt)?)|.")
  
  
--- 47,52 ----
         '                      "http://www.w3.org/TR/REC-html40/loose.dtd">')
  
! fixpat = re.compile("((http|ftp):[-_a-zA-Z0-9/.+~:?#$=&]+)|(pep-\d+(.txt)?)|"
!                     "(RFC[- ]?(?P<rfcnum>\d+))|.")
  
  
***************
*** 69,72 ****
--- 70,76 ----
      elif text[:4] == "pep-" and text != current:
          link = os.path.splitext(text)[0] + ".html"
+     elif text[:3] == 'RFC':
+         link = ('http://www.rfc-editor.org/rfc/rfc%s.txt' %
+                  match.groupdict()['rfcnum'])
      if link:
          return "<a href='%s'>%s</a>" % (link, cgi.escape(text))