MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / generate_help

Function generate_help

src/licensedcode/license_db.py:147–159  ·  view source on GitHub ↗

Generate a help.html with help text at ``output_path`` ``environment`` is a jinja Environment object used to generate the webpage. ``test`` is to generate a stable output for testing only

(output_path, environment, test=False)

Source from the content-addressed store, hash-verified

145
146
147def generate_help(output_path, environment, test=False):
148 """
149 Generate a help.html with help text at ``output_path`` ``environment`` is a
150 jinja Environment object used to generate the webpage. ``test`` is to
151 generate a stable output for testing only
152 """
153 if test:
154 base_context_mapping = base_context_test
155 else:
156 base_context_mapping = base_context
157 template = environment.get_template("help.html")
158 html = template.render(**base_context_mapping)
159 write_file(output_path, "help.html", html)
160
161
162def generate(

Callers 1

generateFunction · 0.85

Calls 2

write_fileFunction · 0.70
renderMethod · 0.45

Tested by

no test coverage detected