[Python-checkins] r88839 - in tracker/instances/python-dev/extensions: local_replace.py test/local_replace_data.txt

ezio.melotti python-checkins at python.org
Thu May 26 03:05:31 CEST 2011


Author: ezio.melotti
Date: Thu May 26 03:05:31 2011
New Revision: 88839

Log:
#399: automatically link to PEPs in the messages.

Modified:
   tracker/instances/python-dev/extensions/local_replace.py
   tracker/instances/python-dev/extensions/test/local_replace_data.txt

Modified: tracker/instances/python-dev/extensions/local_replace.py
==============================================================================
--- tracker/instances/python-dev/extensions/local_replace.py	(original)
+++ tracker/instances/python-dev/extensions/local_replace.py	Thu May 26 03:05:31 2011
@@ -64,6 +64,11 @@
     return ('File "%s<a href="%s%s/Lib/%s#l%s">%s</a>", line %s' %
             (path, baseurl, branch, nfile, lnum, file, lnum))
 
+def make_pep_link(match):
+    text = match.group(0)
+    pepnum = match.group(1).zfill(4)
+    return '<a href="http://www.python.org/dev/peps/pep-%s/">%s</a>' % (pepnum, text)
+
 
 # these regexs have test in tests/test_local_replace.py
 
@@ -91,6 +96,10 @@
                 r'(?!.*site-packages)(python[\d.]*[/\\])?)(?P<file>[-.\w/\\]+?\.py))", '
                 r'line (?P<lnum>\d{1,5})'),
      make_traceback_link),
+
+    # PEP 8, PEP8, PEP 0008, ...
+    (re.compile(r'PEP\s*(\d{1,4})\b', re.I),
+     make_pep_link),
 ]
 
 

Modified: tracker/instances/python-dev/extensions/test/local_replace_data.txt
==============================================================================
--- tracker/instances/python-dev/extensions/test/local_replace_data.txt	(original)
+++ tracker/instances/python-dev/extensions/test/local_replace_data.txt	Thu May 26 03:05:31 2011
@@ -96,6 +96,10 @@
 <a href="http://bugs.python.org/issue1000">http://bugs.python.org/issue1000</a>
 http://svn.python.org/view/python/branches/release26-maint/Lib/socket.py?r1=83624&r2=83623&pathrev=83624
 <a href="http://svn.python.org/view/python/branches/release26-maint/Lib/socket.py?r1=83624&amp;r2=83623&amp;pathrev=83624">http://svn.python.org/view/python/branches/release26-maint/Lib/socket.py?r1=83624&amp;r2=83623&amp;pathrev=83624</a>
+see http://www.python.org/dev/peps/pep-3127/#removal-of-old-octal-syntax
+see <a href="http://www.python.org/dev/peps/pep-3127/#removal-of-old-octal-syntax">http://www.python.org/dev/peps/pep-3127/#removal-of-old-octal-syntax</a>
+see http://docs.python.org/whatsnew/2.6.html#pep-371-the-multiprocessing-package
+see <a href="http://docs.python.org/whatsnew/2.6.html#pep-371-the-multiprocessing-package">http://docs.python.org/whatsnew/2.6.html#pep-371-the-multiprocessing-package</a>
 ##
 ## tracebacks
 File "/usr/lib/python2.7/socket.py", line 553, in create_connection
@@ -168,3 +172,19 @@
 see version1000.
 see version 1000.
 see version 1000.
+##
+##
+see PEP 8
+see <a href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a>
+see PEP8
+see <a href="http://www.python.org/dev/peps/pep-0008/">PEP8</a>
+see pep 8
+see <a href="http://www.python.org/dev/peps/pep-0008/">pep 8</a>
+see PEP 008
+see <a href="http://www.python.org/dev/peps/pep-0008/">PEP 008</a>
+see PEP 3000
+see <a href="http://www.python.org/dev/peps/pep-3000/">PEP 3000</a>
+see PEP 15000
+see PEP 15000
+write a PEP!
+write a PEP!


More information about the Python-checkins mailing list