Return a Jinja template object loaded from the file at `location`.
(location)
| 169 | |
| 170 | |
| 171 | def get_template(location): |
| 172 | """ |
| 173 | Return a Jinja template object loaded from the file at `location`. |
| 174 | """ |
| 175 | from jinja2 import Environment, FileSystemLoader |
| 176 | |
| 177 | location = as_posixpath(abspath(expanduser(location))) |
| 178 | assert isfile(location) |
| 179 | |
| 180 | template_dir = parent_directory(location) |
| 181 | env = Environment(loader=FileSystemLoader(template_dir)) |
| 182 | |
| 183 | template_name = file_name(location) |
| 184 | return env.get_template(template_name) |
| 185 | |
| 186 | |
| 187 | def generate_output(results, license_references, version, template): |
no test coverage detected