Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
doc_class = get_documenters(self.env.app)[objtype]
args = (self.state, ) if sphinx_version >= [2, 1] else ()
params = DocumenterBridge(
env, reporter,
process_documenter_options(doc_class, env.config,
self.options),
lineno, *args)
documenter = doc_class(params, self.arguments[0])
if hasattr(documenter, 'get_grouped_documenters'):
self._autosummary_documenter = documenter
return documenter
# in case the has been changed in the registry, we decide manually
if objtype == 'module':
documenter = AutoSummModuleDocumenter(params, self.arguments[0])
elif objtype == 'class':
documenter = AutoSummClassDocumenter(params, self.arguments[0])
else:
raise ValueError(
"Could not find a valid documenter for the object type %s" % (
objtype))
self._autosummary_documenter = documenter
return documenter