Linkify the PEP numbers in "Superseded-By" header. (#726)

We're already linking PEP numbers in "Replaces:", and "Requires:".
Adjusted the code so it can link "Superseded-By:".
Add the "Replaces:" header where they're missing.
This commit is contained in:
Mariatta 2018-07-10 11:04:15 -07:00 committed by GitHub
parent 9c61127920
commit 3c0a1e18d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@ Type: Informational
Content-Type: text/x-rst
Created: 22-Aug-2001
Post-History:
Replaces: 102
Abstract

View File

@ -9,6 +9,7 @@ Content-Type: text/x-rst
Created: 18-Jun-2002
Python-Version: 2.4
Post-History: 18-Jun-2002, 23-Mar-2004, 22-Aug-2004
Replaces: 215
Abstract

View File

@ -11,6 +11,7 @@ Content-Type: text/x-rst
Created: 2013-02-23
Python-Version: 3.4
Post-History: 2013-02-23, 2013-05-02
Replaces: 354
Resolution: https://mail.python.org/pipermail/python-dev/2013-May/126112.html

View File

@ -8,6 +8,7 @@ Type: Standards Track
Content-Type: text/x-rst
Created: 5-August-2013
Python-Version: 3.4
Replaces: 433
Abstract

View File

@ -10,6 +10,7 @@ Type: Standards Track
Content-Type: text/x-rst
Created: 12-Dec-2012
Post-History: 21-Dec-2012
Replaces: 3153
Resolution: https://mail.python.org/pipermail/python-dev/2013-November/130419.html
Abstract

View File

@ -235,7 +235,7 @@ def fixfile(inpath, input_lines, outfile):
else:
mailtos.append(part)
v = COMMASPACE.join(mailtos)
elif k.lower() in ('replaces', 'replaced-by', 'requires'):
elif k.lower() in ('replaces', 'superseded-by', 'requires'):
otherpeps = ''
for otherpep in re.split(',?\s+', v):
otherpep = int(otherpep)
@ -409,7 +409,7 @@ class PEPHeaders(Transform):
for node in para:
if isinstance(node, nodes.reference):
node.replace_self(peps.mask_email(node, pep))
elif name in ('replaces', 'replaced-by', 'requires'):
elif name in ('replaces', 'superseded-by', 'requires'):
newbody = []
space = nodes.Text(' ')
for refpep in re.split(r',?\s+', body.astext()):

View File

@ -224,7 +224,7 @@ def fixfile(inpath, input_lines, outfile):
else:
mailtos.append(part)
v = COMMASPACE.join(mailtos)
elif k.lower() in ('replaces', 'replaced-by', 'requires'):
elif k.lower() in ('replaces', 'superseded-by', 'requires'):
otherpeps = ''
for otherpep in re.split(',?\s+', v):
otherpep = int(otherpep)