scripts/machine-summary: write per-machine reports with more details

Rename the updates.html format to just 'report'.

This report has the existing overview as the index.html, and then
per-machine files are written with the patch breakdown.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Ross Burton authored and Jon Mason committed 2022-01-19 17:09:58 -05:00
1 parent b1b0f37da7
commit c4b34740cf
5 files changed
+160 -48

No files matched your search

+20 -1
View File
@@ -167,7 +167,26 @@ class TextOverview(Format):
name = "overview.txt"
class HtmlUpdates(Format):
name = "updates.html"
name = "report"
def render(self, context, output: pathlib.Path):
if output.exists() and not output.is_dir():
print(f"{output} is not a directory", file=sys.stderr)
sys.exit(1)
if not output.exists():
output.mkdir(parents=True)
with open(output / "index.html", "wt") as f:
f.write(self.get_template(f"report-index.html.jinja").render(context))
subcontext = context.copy()
del subcontext["data"]
for machine, subdata in context["data"].items():
subcontext["machine"] = machine
subcontext["data"] = subdata
with open(output / f"{machine}.html", "wt") as f:
f.write(self.get_template(f"report-details.html.jinja").render(subcontext))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="machine-summary")