[3/4] scripts/machine-summary: remove default Format.render()

Message ID 20220125165936.1456059-3-ross.burton@arm.com
State New
Headers show
Series [1/4] scripts/machine-summary: remove obsolete is_old test | expand

Commit Message

Ross Burton Jan. 25, 2022, 4:59 p.m. UTC
There's no shared code anymore, so move the code to TextOverview.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 scripts/machine-summary.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py
index 5e66cc1b..0849c579 100755
--- a/scripts/machine-summary.py
+++ b/scripts/machine-summary.py
@@ -142,9 +142,7 @@  class Format:
         return cls.registry[name]()
 
     def render(self, context, output: pathlib.Path):
-        # Default implementation for convenience
-        with open(output, "wt") as f:
-            f.write(self.get_template(f"machine-summary-{self.name}.jinja").render(context))
+        pass
 
     def get_template(self, name):
         template_dir = os.path.dirname(os.path.abspath(__file__))
@@ -160,6 +158,10 @@  class Format:
 class TextOverview(Format):
     name = "overview.txt"
 
+    def render(self, context, output: pathlib.Path):
+        with open(output, "wt") as f:
+            f.write(self.get_template(f"machine-summary-overview.txt.jinja").render(context))
+
 class HtmlUpdates(Format):
     name = "report"