mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
PEP8 cleanup in std.py.
This commit is contained in:
parent
a555bda5eb
commit
a064f43bc0
@ -29,6 +29,8 @@ from sphinx.util.compat import Directive
|
||||
|
||||
# RE for option descriptions
|
||||
option_desc_re = re.compile(r'((?:/|--|-|\+)?[-?@#_a-zA-Z0-9]+)(=?\s*.*)')
|
||||
# RE for grammar tokens
|
||||
token_re = re.compile('`(\w+)`', re.U)
|
||||
|
||||
|
||||
class GenericObject(ObjectDescription):
|
||||
@ -370,8 +372,6 @@ class Glossary(Directive):
|
||||
return messages + [node]
|
||||
|
||||
|
||||
token_re = re.compile('`(\w+)`', re.U)
|
||||
|
||||
def token_xrefs(text):
|
||||
retnodes = []
|
||||
pos = 0
|
||||
@ -558,13 +558,13 @@ class StandardDomain(Domain):
|
||||
if node['refexplicit']:
|
||||
# reference to anonymous label; the reference uses
|
||||
# the supplied link caption
|
||||
docname, labelid = self.data['anonlabels'].get(target, ('',''))
|
||||
docname, labelid = self.data['anonlabels'].get(target, ('', ''))
|
||||
sectname = node.astext()
|
||||
else:
|
||||
# reference to named label; the final node will
|
||||
# contain the section name after the label
|
||||
docname, labelid, sectname = self.data['labels'].get(target,
|
||||
('','',''))
|
||||
('', '', ''))
|
||||
if not docname:
|
||||
return None
|
||||
newnode = nodes.reference('', '', internal=True)
|
||||
@ -586,7 +586,7 @@ class StandardDomain(Domain):
|
||||
return newnode
|
||||
elif typ == 'keyword':
|
||||
# keywords are oddballs: they are referenced by named labels
|
||||
docname, labelid, _ = self.data['labels'].get(target, ('','',''))
|
||||
docname, labelid, _ = self.data['labels'].get(target, ('', '', ''))
|
||||
if not docname:
|
||||
return None
|
||||
return make_refnode(builder, fromdocname, docname,
|
||||
|
Loading…
Reference in New Issue
Block a user