From f90905b4c04cc3efa0bb7b705c0eadd19a09c228 Mon Sep 17 00:00:00 2001 From: chriskiehl Date: Wed, 13 Jul 2016 20:17:03 -0400 Subject: [PATCH] Update model to escape multiline inputs --- gooey/gui/model.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gooey/gui/model.py b/gooey/gui/model.py index 53462c1..5b99ff1 100644 --- a/gooey/gui/model.py +++ b/gooey/gui/model.py @@ -37,11 +37,11 @@ class MyWidget(object): if self.commands and value: return u'{} {}'.format(self.commands[0], value) return value or None - # if self.type == 'TextField': - # if self.commands and self._value: - # return '{} {}'.format(self.commands[0], quote(self._value)) - # else: - # return quote(self._value) if self._value else '' + if self.type == 'Textarea': + if self.commands and self._value: + return '{} {}'.format(self.commands[0], quote(self._value.encode('unicode_escape'))) + else: + return quote(self._value.encode('unicode_escape')) if self._value else '' if self.type == 'CommandField': if self.commands and self._value: return u'{} {}'.format(self.commands[0], self._value)