[2.0.x] Removed usage of deprecated sphinx APIs.

Backport of cc4bb110d3 from master
This commit is contained in:
Tim Graham 2018-09-10 16:08:21 -04:00
parent aa1527db57
commit 4a62b44af3
1 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ from docutils.parsers.rst import Directive, directives
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.domains.std import Cmdoption
from sphinx.util import logging
from sphinx.util.console import bold
from sphinx.util.nodes import set_source_info
@ -18,6 +19,7 @@ try:
except ImportError: # Sphinx 1.6+
from sphinx.writers.html import HTMLTranslator
logger = logging.getLogger(__name__)
# RE for option descriptions without a '--' prefix
simple_option_desc_re = re.compile(
r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
@ -44,7 +46,7 @@ def setup(app):
rolename="lookup",
indextemplate="pair: %s; field lookup type",
)
app.add_description_unit(
app.add_object_type(
directivename="django-admin",
rolename="djadmin",
indextemplate="pair: %s; django-admin command",
@ -310,7 +312,7 @@ class DjangoStandaloneHTMLBuilder(StandaloneHTMLBuilder):
def finish(self):
super().finish()
self.info(bold("writing templatebuiltins.js..."))
logger.info(bold("writing templatebuiltins.js..."))
xrefs = self.env.domaindata["std"]["objects"]
templatebuiltins = {
"ttags": [