From 63b58edda11e34b02123ff0e9944c3c2c3bc17ba Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 18 Oct 2012 12:27:53 -0700 Subject: Allow passing form instructions as a list of strings. --- sleekxmpp/plugins/xep_0004/stanza/form.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/plugins/xep_0004/stanza') diff --git a/sleekxmpp/plugins/xep_0004/stanza/form.py b/sleekxmpp/plugins/xep_0004/stanza/form.py index bbf0ee7d..721ecc35 100644 --- a/sleekxmpp/plugins/xep_0004/stanza/form.py +++ b/sleekxmpp/plugins/xep_0004/stanza/form.py @@ -201,7 +201,8 @@ class Form(ElementBase): del self['instructions'] if instructions in [None, '']: return - instructions = instructions.split('\n') + if not isinstance(instructions, list): + instructions = instructions.split('\n') for instruction in instructions: inst = ET.Element('{%s}instructions' % self.namespace) inst.text = instruction -- cgit v1.2.3