mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
sphinx.environment: PEP8 cleanup.
This commit is contained in:
@@ -38,7 +38,7 @@ from sphinx import addnodes
|
||||
from sphinx.util import url_re, get_matching_docs, docname_join, split_into, \
|
||||
FilenameUniqDict
|
||||
from sphinx.util.nodes import clean_astext, make_refnode, WarningStream
|
||||
from sphinx.util.osutil import SEP, fs_encoding, find_catalog_files
|
||||
from sphinx.util.osutil import SEP, find_catalog_files
|
||||
from sphinx.util.matching import compile_matchers
|
||||
from sphinx.util.websupport import is_commentable
|
||||
from sphinx.errors import SphinxError, ExtensionError
|
||||
@@ -52,7 +52,9 @@ from sphinx.transforms import DefaultSubstitutions, MoveModuleTargets, \
|
||||
orig_role_function = roles.role
|
||||
orig_directive_function = directives.directive
|
||||
|
||||
class ElementLookupError(Exception): pass
|
||||
|
||||
class ElementLookupError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
default_settings = {
|
||||
@@ -1102,7 +1104,6 @@ class BuildEnvironment:
|
||||
stream=WarningStream(self._warnfunc))
|
||||
return doctree
|
||||
|
||||
|
||||
def get_and_resolve_doctree(self, docname, builder, doctree=None,
|
||||
prune_toctrees=True, includehidden=False):
|
||||
"""Read the doctree from the pickle, resolve cross-references and
|
||||
@@ -1117,7 +1118,8 @@ class BuildEnvironment:
|
||||
# now, resolve all toctree nodes
|
||||
for toctreenode in doctree.traverse(addnodes.toctree):
|
||||
result = self.resolve_toctree(docname, builder, toctreenode,
|
||||
prune=prune_toctrees, includehidden=includehidden)
|
||||
prune=prune_toctrees,
|
||||
includehidden=includehidden)
|
||||
if result is None:
|
||||
toctreenode.replace_self([])
|
||||
else:
|
||||
@@ -1622,6 +1624,7 @@ class BuildEnvironment:
|
||||
def collect_relations(self):
|
||||
relations = {}
|
||||
getinc = self.toctree_includes.get
|
||||
|
||||
def collect(parents, parents_set, docname, previous, next):
|
||||
# circular relationship?
|
||||
if docname in parents_set:
|
||||
|
||||
Reference in New Issue
Block a user