# HG changeset patch # User Goffi # Date 1503529907 -7200 # Node ID 18d71226b3a88ff34c5505c59a3d074b88cc6788 # Parent b6dee1f66478293ffd447afebdf2bad8edb9d632 jp (output/template): check if there is a template before initializing Renderer diff -r b6dee1f66478 -r 18d71226b3a8 frontends/src/jp/output_template.py --- a/frontends/src/jp/output_template.py Wed Aug 23 00:52:36 2017 +0200 +++ b/frontends/src/jp/output_template.py Thu Aug 24 01:11:47 2017 +0200 @@ -48,18 +48,19 @@ 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) try: template_path = cmd.TEMPLATE except AttributeError: if not 'template' in cmd.args.output_opts: self.host.disp(u'no default template set for this command, ' - u'you need to specify a template using --oo template=[path/to/template.html', + u'you need to specify a template using --oo template=[path/to/template.html]', error=True) self.host.quit(C.EXIT_BAD_ARG) + + options = self.host.parse_output_options() + self.host.check_output_options(OPTIONS, options) + self.renderer = template.Renderer(self.host) try: template_path = options['template'] except KeyError: