Skip to content

Commit

Permalink
LaTeX: deprecate optional argument scre to visit_index()
Browse files Browse the repository at this point in the history
And it is already ignored.
  • Loading branch information
jfbu committed Nov 4, 2018
1 parent 0f45cf7 commit 00a75b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sphinx/writers/latex.py
Expand Up @@ -169,6 +169,8 @@
},
} # type: Dict[unicode, Dict[unicode, unicode]]

EXTRA_RE = re.compile(r'^(.*\S)\s+\(([^()]*)\)\s*$')


class collected_footnote(nodes.footnote):
"""Footnotes that are collected are assigned this class."""
Expand Down Expand Up @@ -1884,8 +1886,8 @@ def depart_attribution(self, node):
# type: (nodes.Node) -> None
self.body.append('\n\\end{flushright}\n')

def visit_index(self, node, extrare=re.compile(r'^(.*\S)\s+\(([^()]*)\)\s*$')):
# type: (nodes.Node, Pattern) -> None
def visit_index(self, node, scre = None):
# type: (nodes.Node, None) -> None
def escape(value):
value = self.encode(value)
value = value.replace(r'\{', r'\sphinxleftcurlybrace{}')
Expand All @@ -1896,12 +1898,16 @@ def escape(value):
return value

def style(string):
match = extrare.match(string)
match = EXTRA_RE.match(string)
if match:
return match.expand(r'\\spxentry{\1}\\spxextra{\2}')
else:
return '\\spxentry{%s}' % string

if scre:
warnings.warn(('LaTeXTranslator.visit_index() optional argument '
'"scre" is deprecated. It is ignored.'),
RemovedInSphinx30Warning, stacklevel=2)
if not node.get('inline', True):
self.body.append('\n')
entries = node['entries']
Expand Down

0 comments on commit 00a75b2

Please sign in to comment.