diff options
author | Georg Brandl <georg@python.org> | 2012-10-01 17:09:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-10-01 17:09:00 (GMT) |
commit | a32e8dfe129143dddf77323bce44702980ee0421 (patch) | |
tree | 74f93d9e7add5ddfa343ea21b766d26fb3925dbd /Doc/tools | |
parent | 86dc732f1f80ac97f7efa92ff3a2378b6158abc4 (diff) | |
parent | 44d0c2156a292b2e9297b2220941e340d4ec32df (diff) | |
download | cpython-a32e8dfe129143dddf77323bce44702980ee0421.zip cpython-a32e8dfe129143dddf77323bce44702980ee0421.tar.gz cpython-a32e8dfe129143dddf77323bce44702980ee0421.tar.bz2 |
merge with 3.3.
Diffstat (limited to 'Doc/tools')
-rw-r--r-- | Doc/tools/sphinxext/pyspecific.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py index aa6e85f..654ef3d 100644 --- a/Doc/tools/sphinxext/pyspecific.py +++ b/Doc/tools/sphinxext/pyspecific.py @@ -149,10 +149,9 @@ class DeprecatedRemoved(Directive): import re import codecs -from docutils.statemachine import string2lines -from sphinx.util.nodes import nested_parse_with_titles -issue_re = re.compile('Issue #([0-9]+)') +issue_re = re.compile('([Ii])ssue #([0-9]+)') +whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$") class MiscNews(Directive): has_content = False @@ -166,8 +165,10 @@ class MiscNews(Directive): source = self.state_machine.input_lines.source( self.lineno - self.state_machine.input_offset - 1) source_dir = path.dirname(path.abspath(source)) + fpath = path.join(source_dir, fname) + self.state.document.settings.record_dependencies.add(fpath) try: - fp = codecs.open(path.join(source_dir, fname), encoding='utf-8') + fp = codecs.open(fpath, encoding='utf-8') try: content = fp.read() finally: @@ -176,8 +177,9 @@ class MiscNews(Directive): text = 'The NEWS file is not available.' node = nodes.strong(text, text) return [node] - content = issue_re.sub(r'`Issue #\1 <http://bugs.python.org/\1>`__', + content = issue_re.sub(r'`\1ssue #\2 <http://bugs.python.org/\2>`__', content) + content = whatsnew_re.sub(r'\1', content) # remove first 3 lines as they are the main heading lines = content.splitlines()[3:] self.state_machine.insert_input(lines, fname) |