| 794 | out_file.write(transformed_html) |
| 795 | |
| 796 | def on_finish(self) -> None: |
| 797 | last_xml = self.memory_xml.last_xml |
| 798 | assert last_xml is not None |
| 799 | out_path = os.path.join(self.output_dir, "index.html") |
| 800 | out_css = os.path.join(self.output_dir, "mypy-html.css") |
| 801 | transformed_html = bytes(self.xslt_html(last_xml, ext=self.param_html)) |
| 802 | with open(out_path, "wb") as out_file: |
| 803 | out_file.write(transformed_html) |
| 804 | shutil.copyfile(self.memory_xml.css_html_path, out_css) |
| 805 | print("Generated HTML report (via XSLT):", os.path.abspath(out_path)) |
| 806 | |
| 807 | |
| 808 | register_reporter("xslt-html", XsltHtmlReporter, needs_lxml=True) |