mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-05-06 04:42:16 +00:00
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>
This commit is contained in:
@@ -142,9 +142,7 @@ class Format:
|
|||||||
return cls.registry[name]()
|
return cls.registry[name]()
|
||||||
|
|
||||||
def render(self, context, output: pathlib.Path):
|
def render(self, context, output: pathlib.Path):
|
||||||
# Default implementation for convenience
|
pass
|
||||||
with open(output, "wt") as f:
|
|
||||||
f.write(self.get_template(f"machine-summary-{self.name}.jinja").render(context))
|
|
||||||
|
|
||||||
def get_template(self, name):
|
def get_template(self, name):
|
||||||
template_dir = os.path.dirname(os.path.abspath(__file__))
|
template_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
@@ -160,6 +158,10 @@ class Format:
|
|||||||
class TextOverview(Format):
|
class TextOverview(Format):
|
||||||
name = "overview.txt"
|
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):
|
class HtmlUpdates(Format):
|
||||||
name = "report"
|
name = "report"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user