def generate_report(name, report_schema, filter_criterion=None): builder = create_builder() #builder = create_builder_new(filter_criterion) text = Text() env = Environment(loader=FileSystemLoader('../webgui/templates')) template = env.get_template("_static_report.html") result = builder.report_and_stats(report_schema, filter_year=filter_criterion) #result = builder.report_and_stats(report_schema) text.change_newline_in_report(report_schema['keywords'], result.report) xhtml = template.render(keywords=report_schema['keywords'], report=result.report, links=get_all_descs(), stats=result.report_stats.get_text() ) write(name, xhtml)