Skip to content

Commit

Permalink
[2.0.x] Removed usage of deprecated sphinx APIs.
Browse files Browse the repository at this point in the history
Backport of cc4bb11 from master
  • Loading branch information
timgraham committed Nov 17, 2018
1 parent aa1527d commit 4a62b44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/_ext/djangodocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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

Expand All @@ -18,6 +19,7 @@
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+(?:/|-|--)|$)')
Expand All @@ -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",
Expand Down Expand Up @@ -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": [
Expand Down

0 comments on commit 4a62b44

Please sign in to comment.