diff options
author | Lance Stout <lancestout@gmail.com> | 2012-01-05 11:33:47 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-01-05 11:33:47 -0500 |
commit | 8fd2efa2fa50751af7b5182ad7793295c540d294 (patch) | |
tree | 7639768de4d93b00e998f3575b02830b2ac97b44 /sleekxmpp/plugins/xep_0004/stanza/field.py | |
parent | 79f1aa0e1ba7dd29bf597beeae924b96950f9416 (diff) | |
parent | 6b6995bb0b80c91eda72bc92974f68133cef93a3 (diff) | |
download | slixmpp-8fd2efa2fa50751af7b5182ad7793295c540d294.tar.gz slixmpp-8fd2efa2fa50751af7b5182ad7793295c540d294.tar.bz2 slixmpp-8fd2efa2fa50751af7b5182ad7793295c540d294.tar.xz slixmpp-8fd2efa2fa50751af7b5182ad7793295c540d294.zip |
Merge branch 'develop-1.1' into develop
Diffstat (limited to 'sleekxmpp/plugins/xep_0004/stanza/field.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0004/stanza/field.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sleekxmpp/plugins/xep_0004/stanza/field.py b/sleekxmpp/plugins/xep_0004/stanza/field.py index 8131233c..6814e157 100644 --- a/sleekxmpp/plugins/xep_0004/stanza/field.py +++ b/sleekxmpp/plugins/xep_0004/stanza/field.py @@ -79,19 +79,21 @@ class FormField(ElementBase): reqXML = self.xml.find('{%s}required' % self.namespace) return reqXML is not None - def get_value(self): + def get_value(self, convert=True): valsXML = self.xml.findall('{%s}value' % self.namespace) if len(valsXML) == 0: return None elif self._type == 'boolean': - return valsXML[0].text in self.true_values + if convert: + return valsXML[0].text in self.true_values + return valsXML[0].text elif self._type in self.multi_value_types or len(valsXML) > 1: values = [] for valXML in valsXML: if valXML.text is None: valXML.text = '' values.append(valXML.text) - if self._type == 'text-multi': + if self._type == 'text-multi' and condense: values = "\n".join(values) return values else: |