def generate_automodsumm_docs(lines, srcfn, suffix='<STR_LIT>', warn=None,<EOL>info=None, base_path=None, builder=None,<EOL>template_dir=None):
from sphinx.jinja2glue import BuiltinTemplateLoader<EOL>from sphinx.ext.autosummary import import_by_name, get_documenter<EOL>from sphinx.ext.autosummary.generate import (find_autosummary_in_lines,<EOL>_simple_info, _simple_warn)<EOL>from sphinx.util.osutil import ensuredir<EOL>from sphinx.util.inspect import safe_getattr<EOL>from jinja2 import FileSystemLoader, TemplateNotFound<EOL>from jinja2.sandbox import SandboxedEnvironment<EOL>if info is None:<EOL><INDENT>info = _simple_info<EOL><DEDENT>if warn is None:<EOL><INDENT>warn = _simple_warn<EOL><DEDENT>template_dirs = [os.path.join(os.path.dirname(__file__), '<STR_LIT>'),<EOL>os.path.join(base_path, '<STR_LIT>')]<EOL>if builder is not None:<EOL><INDENT>template_loader = BuiltinTemplateLoader()<EOL>template_loader.init(builder, dirs=template_dirs)<EOL><DEDENT>else:<EOL><INDENT>if template_dir:<EOL><INDENT>template_dirs.insert(<NUM_LIT:0>, template_dir)<EOL><DEDENT>template_loader = FileSystemLoader(template_dirs)<EOL><DEDENT>template_env = SandboxedEnvironment(loader=template_loader)<EOL>items = find_autosummary_in_lines(lines, filename=srcfn)<EOL>if len(items) > <NUM_LIT:0>:<EOL><INDENT>msg = '<STR_LIT>'<EOL>info(msg.format(len(items), srcfn))<EOL>
This function is adapted from
`sphinx.ext.autosummary.generate.generate_autosummmary_docs` to
generate source for the automodsumm directives that should be
autosummarized. Unlike generate_autosummary_docs, this function is
called one file at a time.