Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a32e8df

Browse files
committed
merge with 3.3.
2 parents 86dc732 + 44d0c21 commit a32e8df

4 files changed

Lines changed: 15 additions & 13 deletions

File tree

Doc/tools/sphinxext/pyspecific.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ def run(self):
149149

150150
import re
151151
import codecs
152-
from docutils.statemachine import string2lines
153-
from sphinx.util.nodes import nested_parse_with_titles
154152

155-
issue_re = re.compile('Issue #([0-9]+)')
153+
issue_re = re.compile('([Ii])ssue #([0-9]+)')
154+
whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$")
156155

157156
class MiscNews(Directive):
158157
has_content = False
@@ -166,8 +165,10 @@ def run(self):
166165
source = self.state_machine.input_lines.source(
167166
self.lineno - self.state_machine.input_offset - 1)
168167
source_dir = path.dirname(path.abspath(source))
168+
fpath = path.join(source_dir, fname)
169+
self.state.document.settings.record_dependencies.add(fpath)
169170
try:
170-
fp = codecs.open(path.join(source_dir, fname), encoding='utf-8')
171+
fp = codecs.open(fpath, encoding='utf-8')
171172
try:
172173
content = fp.read()
173174
finally:
@@ -176,8 +177,9 @@ def run(self):
176177
text = 'The NEWS file is not available.'
177178
node = nodes.strong(text, text)
178179
return [node]
179-
content = issue_re.sub(r'`Issue #\1 <http://bugs.python.org/\1>`__',
180+
content = issue_re.sub(r'`\1ssue #\2 <http://bugs.python.org/\2>`__',
180181
content)
182+
content = whatsnew_re.sub(r'\1', content)
181183
# remove first 3 lines as they are the main heading
182184
lines = content.splitlines()[3:]
183185
self.state_machine.insert_input(lines, fname)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
+++++++++++
2-
Python News
3-
+++++++++++
1+
+++++++++
2+
Changelog
3+
+++++++++
44

55
.. raw:: html
66

Doc/whatsnew/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ anyone wishing to stay up-to-date after a new release.
2525
2.1.rst
2626
2.0.rst
2727

28-
The "Python News" is a HTML version of the file :source:`Misc/NEWS` which
29-
contains *all* nontrivial changes to Python.
28+
The "Changelog" is a HTML version of the file :source:`Misc/NEWS` which
29+
contains *all* nontrivial changes to Python for the current version.
3030

3131
.. toctree::
32-
:maxdepth: 1
32+
:maxdepth: 2
3333

34-
news.rst
34+
changelog.rst

Misc/NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Library
7878
- Issue #15509: webbrowser.UnixBrowser no longer passes empty arguments to
7979
Popen when %action substitutions produce empty strings.
8080

81-
- Issues #12776, #11839: call argparse type function (specified by add_argument)
81+
- Issue #12776, issue #11839: call argparse type function (specified by add_argument)
8282
only once. Before, the type function was called twice in the case where the
8383
default was specified and the argument was given as well. This was especially
8484
problematic for the FileType type, as a default file would always be opened,

0 commit comments

Comments
 (0)