mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Do not pass attr_docs as an argument into ModuleScanner.scan
This commit is contained in:
parent
033ebab15e
commit
d955098ef9
@ -193,8 +193,10 @@ class ModuleScanner:
|
|||||||
name, exc, type='autosummary')
|
name, exc, type='autosummary')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def scan(self, imported_members: bool, attr_docs: Mapping[str,str] = {}) -> List[str]:
|
def scan(self, imported_members: bool) -> List[str]:
|
||||||
members = []
|
members = []
|
||||||
|
analyzer = ModuleAnalyzer.for_module(self.object.__name__)
|
||||||
|
attr_docs = analyzer.find_attr_docs()
|
||||||
for name in members_of(self.object, self.app.config):
|
for name in members_of(self.object, self.app.config):
|
||||||
try:
|
try:
|
||||||
value = safe_getattr(self.object, name)
|
value = safe_getattr(self.object, name)
|
||||||
@ -306,6 +308,8 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any,
|
|||||||
"""Find module attributes with docstrings."""
|
"""Find module attributes with docstrings."""
|
||||||
attrs, public = [], []
|
attrs, public = [], []
|
||||||
try:
|
try:
|
||||||
|
analyzer = ModuleAnalyzer.for_module(name)
|
||||||
|
attr_docs = analyzer.find_attr_docs()
|
||||||
for namespace, attr_name in attr_docs:
|
for namespace, attr_name in attr_docs:
|
||||||
if namespace == '' and attr_name in members:
|
if namespace == '' and attr_name in members:
|
||||||
attrs.append(attr_name)
|
attrs.append(attr_name)
|
||||||
@ -334,10 +338,8 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any,
|
|||||||
ns.update(context)
|
ns.update(context)
|
||||||
|
|
||||||
if doc.objtype == 'module':
|
if doc.objtype == 'module':
|
||||||
analyzer = ModuleAnalyzer.for_module(name)
|
|
||||||
attr_docs = analyzer.find_attr_docs()
|
|
||||||
scanner = ModuleScanner(app, obj)
|
scanner = ModuleScanner(app, obj)
|
||||||
ns['members'] = scanner.scan(imported_members, attr_docs)
|
ns['members'] = scanner.scan(imported_members)
|
||||||
ns['functions'], ns['all_functions'] = \
|
ns['functions'], ns['all_functions'] = \
|
||||||
get_members(obj, {'function'}, imported=imported_members)
|
get_members(obj, {'function'}, imported=imported_members)
|
||||||
ns['classes'], ns['all_classes'] = \
|
ns['classes'], ns['all_classes'] = \
|
||||||
|
Loading…
Reference in New Issue
Block a user