mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
insert blank line(s) to adapt latest flake8/pycodestyle
This commit is contained in:
parent
9f39b53c16
commit
d50b9b9dce
@ -39,6 +39,8 @@ class desc_signature(nodes.Part, nodes.Inline, nodes.TextElement):
|
|||||||
|
|
||||||
class desc_addname(nodes.Part, nodes.Inline, nodes.TextElement):
|
class desc_addname(nodes.Part, nodes.Inline, nodes.TextElement):
|
||||||
"""Node for additional name parts (module name, class name)."""
|
"""Node for additional name parts (module name, class name)."""
|
||||||
|
|
||||||
|
|
||||||
# compatibility alias
|
# compatibility alias
|
||||||
desc_classname = desc_addname
|
desc_classname = desc_addname
|
||||||
|
|
||||||
|
@ -384,6 +384,7 @@ Note: By default this script will not overwrite already created files.""")
|
|||||||
elif not opts.notoc:
|
elif not opts.notoc:
|
||||||
create_modules_toc_file(modules, opts)
|
create_modules_toc_file(modules, opts)
|
||||||
|
|
||||||
|
|
||||||
# So program can be started with "python -m sphinx.apidoc ..."
|
# So program can be started with "python -m sphinx.apidoc ..."
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -452,6 +452,7 @@ class Builder(object):
|
|||||||
optname = '%s_%s' % (default, option)
|
optname = '%s_%s' % (default, option)
|
||||||
return getattr(self.config, optname)
|
return getattr(self.config, optname)
|
||||||
|
|
||||||
|
|
||||||
BUILTIN_BUILDERS = {
|
BUILTIN_BUILDERS = {
|
||||||
'dummy': ('dummy', 'DummyBuilder'),
|
'dummy': ('dummy', 'DummyBuilder'),
|
||||||
'html': ('html', 'StandaloneHTMLBuilder'),
|
'html': ('html', 'StandaloneHTMLBuilder'),
|
||||||
|
@ -150,6 +150,7 @@ class LocalTimeZone(tzinfo):
|
|||||||
def dst(self, dt):
|
def dst(self, dt):
|
||||||
return timedelta(0)
|
return timedelta(0)
|
||||||
|
|
||||||
|
|
||||||
ltz = LocalTimeZone()
|
ltz = LocalTimeZone()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1181,6 +1181,7 @@ class PickleHTMLBuilder(SerializingHTMLBuilder):
|
|||||||
globalcontext_filename = 'globalcontext.pickle'
|
globalcontext_filename = 'globalcontext.pickle'
|
||||||
searchindex_filename = 'searchindex.pickle'
|
searchindex_filename = 'searchindex.pickle'
|
||||||
|
|
||||||
|
|
||||||
# compatibility alias
|
# compatibility alias
|
||||||
WebHTMLBuilder = PickleHTMLBuilder
|
WebHTMLBuilder = PickleHTMLBuilder
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ class RedirectHandler(HTTPRedirectHandler):
|
|||||||
req.redirect_code = code
|
req.redirect_code = code
|
||||||
return new_req
|
return new_req
|
||||||
|
|
||||||
|
|
||||||
# create an opener that will simulate a browser user-agent
|
# create an opener that will simulate a browser user-agent
|
||||||
opener = build_opener(RedirectHandler)
|
opener = build_opener(RedirectHandler)
|
||||||
opener.addheaders = [('User-agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) '
|
opener.addheaders = [('User-agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) '
|
||||||
|
@ -160,6 +160,7 @@ class ObjectDescription(Directive):
|
|||||||
self.after_content()
|
self.after_content()
|
||||||
return [self.indexnode, node]
|
return [self.indexnode, node]
|
||||||
|
|
||||||
|
|
||||||
# backwards compatible old name
|
# backwards compatible old name
|
||||||
DescDirective = ObjectDescription
|
DescDirective = ObjectDescription
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ def members_set_option(arg):
|
|||||||
return ALL
|
return ALL
|
||||||
return set(x.strip() for x in arg.split(','))
|
return set(x.strip() for x in arg.split(','))
|
||||||
|
|
||||||
|
|
||||||
SUPPRESS = object()
|
SUPPRESS = object()
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,6 +152,7 @@ def lazy_gettext(string):
|
|||||||
# return string
|
# return string
|
||||||
return _TranslationProxy(mygettext, string)
|
return _TranslationProxy(mygettext, string)
|
||||||
|
|
||||||
|
|
||||||
l_ = lazy_gettext
|
l_ = lazy_gettext
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ pydriver = driver.Driver(pygrammar, convert=nodes.convert)
|
|||||||
# an object with attributes corresponding to token and symbol names
|
# an object with attributes corresponding to token and symbol names
|
||||||
class sym:
|
class sym:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
for k, v in iteritems(pygrammar.symbol2number):
|
for k, v in iteritems(pygrammar.symbol2number):
|
||||||
setattr(sym, k, v)
|
setattr(sym, k, v)
|
||||||
for k, v in iteritems(token.tok_name):
|
for k, v in iteritems(token.tok_name):
|
||||||
|
@ -1516,6 +1516,7 @@ def usage(argv, msg=None):
|
|||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
print(file=sys.stderr)
|
print(file=sys.stderr)
|
||||||
|
|
||||||
|
|
||||||
USAGE = """\
|
USAGE = """\
|
||||||
Sphinx v%s
|
Sphinx v%s
|
||||||
Usage: %%prog [options] [projectdir]
|
Usage: %%prog [options] [projectdir]
|
||||||
@ -1681,5 +1682,6 @@ def main(argv=sys.argv):
|
|||||||
|
|
||||||
generate(d)
|
generate(d)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main(sys.argv))
|
sys.exit(main(sys.argv))
|
||||||
|
@ -212,6 +212,7 @@ def copy_extra_entry(source, targetdir, exclude_matchers=()):
|
|||||||
for file in files:
|
for file in files:
|
||||||
copy_extra_file(os.path.join(root, file), reltargetdir)
|
copy_extra_file(os.path.join(root, file), reltargetdir)
|
||||||
|
|
||||||
|
|
||||||
_DEBUG_HEADER = '''\
|
_DEBUG_HEADER = '''\
|
||||||
# Sphinx version: %s
|
# Sphinx version: %s
|
||||||
# Python version: %s (%s)
|
# Python version: %s (%s)
|
||||||
|
@ -90,6 +90,7 @@ def create_color_func(name):
|
|||||||
return colorize(name, text)
|
return colorize(name, text)
|
||||||
globals()[name] = inner
|
globals()[name] = inner
|
||||||
|
|
||||||
|
|
||||||
_attrs = {
|
_attrs = {
|
||||||
'reset': '39;49;00m',
|
'reset': '39;49;00m',
|
||||||
'bold': '01m',
|
'bold': '01m',
|
||||||
|
@ -125,6 +125,7 @@ def find_catalog_source_files(locale_dirs, locale, domains=None, gettext_compact
|
|||||||
|
|
||||||
return catalogs
|
return catalogs
|
||||||
|
|
||||||
|
|
||||||
# date_format mappings: ustrftime() to bable.dates.format_datetime()
|
# date_format mappings: ustrftime() to bable.dates.format_datetime()
|
||||||
date_format_mappings = {
|
date_format_mappings = {
|
||||||
'%a': 'EEE', # Weekday as locale’s abbreviated name.
|
'%a': 'EEE', # Weekday as locale’s abbreviated name.
|
||||||
|
@ -302,4 +302,5 @@ def _new_copy(self):
|
|||||||
newnode.line = self.line
|
newnode.line = self.line
|
||||||
return newnode
|
return newnode
|
||||||
|
|
||||||
|
|
||||||
nodes.Element.copy = _new_copy
|
nodes.Element.copy = _new_copy
|
||||||
|
@ -147,6 +147,7 @@ class _DeprecationWrapper(object):
|
|||||||
return self._deprecated[attr]
|
return self._deprecated[attr]
|
||||||
return getattr(self._mod, attr)
|
return getattr(self._mod, attr)
|
||||||
|
|
||||||
|
|
||||||
sys.modules[__name__] = _DeprecationWrapper(sys.modules[__name__], dict(
|
sys.modules[__name__] = _DeprecationWrapper(sys.modules[__name__], dict(
|
||||||
zip_longest = zip_longest,
|
zip_longest = zip_longest,
|
||||||
product = product,
|
product = product,
|
||||||
|
@ -81,8 +81,8 @@ def sphinx_smarty_pants(t):
|
|||||||
t = t.replace('"', '"')
|
t = t.replace('"', '"')
|
||||||
return t
|
return t
|
||||||
|
|
||||||
# Constants for quote education.
|
|
||||||
|
|
||||||
|
# Constants for quote education.
|
||||||
punct_class = r"""[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]"""
|
punct_class = r"""[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]"""
|
||||||
end_of_word_class = r"""[\s.,;:!?)]"""
|
end_of_word_class = r"""[\s.,;:!?)]"""
|
||||||
close_class = r"""[^\ \t\r\n\[\{\(\-]"""
|
close_class = r"""[^\ \t\r\n\[\{\(\-]"""
|
||||||
|
Loading…
Reference in New Issue
Block a user