Pārlūkot izejas kodu

scripts/machine-summary: remove default Format.render()

There's no shared code anymore, so move the code to TextOverview.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Ross Burton 3 gadi atpakaļ
vecāks
revīzija
38cd9b6f59
1 mainītis faili ar 5 papildinājumiem un 3 dzēšanām
  1. 5 3
      scripts/machine-summary.py

+ 5 - 3
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"