fix pydoc-topics to work with Sphinx 1.7 (GH-6475)
In fact, we now require a newer Sphinx version because APIs have moved around.
(cherry picked from commit acfb087f9f
)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
This commit is contained in:
parent
3b4e756b43
commit
7899153c1f
|
@ -23,9 +23,10 @@ from docutils import nodes, utils
|
|||
from sphinx import addnodes
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.locale import translators
|
||||
from sphinx.util import status_iterator
|
||||
from sphinx.util.nodes import split_explicit_title
|
||||
from sphinx.writers.html import HTMLTranslator
|
||||
from sphinx.writers.text import TextWriter
|
||||
from sphinx.writers.text import TextWriter, TextTranslator
|
||||
from sphinx.writers.latex import LaTeXTranslator
|
||||
from sphinx.domains.python import PyModulelevel, PyClassmember
|
||||
|
||||
|
@ -295,8 +296,11 @@ pydoc_topic_labels = [
|
|||
class PydocTopicsBuilder(Builder):
|
||||
name = 'pydoc-topics'
|
||||
|
||||
default_translator_class = TextTranslator
|
||||
|
||||
def init(self):
|
||||
self.topics = {}
|
||||
self.secnumbers = {}
|
||||
|
||||
def get_outdated_docs(self):
|
||||
return 'all pydoc topics'
|
||||
|
@ -306,7 +310,7 @@ class PydocTopicsBuilder(Builder):
|
|||
|
||||
def write(self, *ignored):
|
||||
writer = TextWriter(self)
|
||||
for label in self.status_iterator(pydoc_topic_labels,
|
||||
for label in status_iterator(pydoc_topic_labels,
|
||||
'building topics... ',
|
||||
length=len(pydoc_topic_labels)):
|
||||
if label not in self.env.domaindata['std']['labels']:
|
||||
|
|
Loading…
Reference in New Issue