File: generate.py

package info (click to toggle)
python-resolvelib 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,524 kB
  • sloc: python: 2,367; javascript: 102; sh: 9; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os

import jinja2

environment = jinja2.Environment(
    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
    autoescape=True,
)


def generate_html(dot_source_list, outfile):
    template = environment.get_template("main.html")
    iterable = template.generate(dot_source_list=dot_source_list)

    for item in iterable:
        outfile.write(item)