From 3911207709d61cc4244fe6838e0a3c9ba0d73574 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Wed, 20 May 2015 07:52:19 +0200 Subject: [PATCH] Don't do anything with script output if we're in raw output mode. --- src/scriptform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scriptform.py b/src/scriptform.py index 2e225c5..fa1d1bc 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -962,13 +962,16 @@ class ScriptFormWebApp(WebAppHandler): log.info("Variables: {0}".format(dict(form_values.items()))) result = form_config.callback(form_name, form_values, self.wfile, self.wfile) - if result: + if form_def.output != 'raw': + # Ignore everything if we're doing raw output, since it's the + # scripts responsibility. if result['exitcode'] != 0: msg = u'{0}'.format(cgi.escape(result['stderr'].decode('utf8'))) else: if form_def.output == 'escaped': msg = u'
{0}
'.format(cgi.escape(result['stdout'].decode('utf8'))) else: + # Non-escaped output (html, usually) msg = result['stdout'].decode('utf8') output = html_submit_response.format(