# HG changeset patch # User Goffi # Date 1495374743 -7200 # Node ID a81261cee29bf0441b95d04bdfb511d07d609d79 # Parent 0f3bfe89999ede0846b79bd031d9f66d329b6c19 jp (output/template): initialize template rendered only if a rendering is actually needed diff -r 0f3bfe89999e -r a81261cee29b frontends/src/jp/output_template.py --- a/frontends/src/jp/output_template.py Sun May 21 15:47:53 2017 +0200 +++ b/frontends/src/jp/output_template.py Sun May 21 15:52:23 2017 +0200 @@ -37,7 +37,6 @@ def __init__(self, jp): self.host = jp jp.register_output(C.OUTPUT_COMPLEX, TEMPLATE, self.render) - self.renderer = template.Renderer(jp) def render(self, data): """render output data using requested template @@ -49,6 +48,7 @@ command's template_data_mapping attribute will be used if it exists to convert data to a dict usable by the template. """ + self.renderer = template.Renderer(self.host) cmd = self.host.command options = self.host.parse_output_options() self.host.check_output_options(OPTIONS, options)