From 116bb6e1b9e5c9d067b2a522d595eaa75e31be6b Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 13 Dec 2011 09:00:45 -0800 Subject: [PATCH] Use OrderedDicts instead of regular dictionaries when returning values from forms. --- sleekxmpp/plugins/xep_0004/stanza/form.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sleekxmpp/plugins/xep_0004/stanza/form.py b/sleekxmpp/plugins/xep_0004/stanza/form.py index 1fcd707..bbf0ee7 100644 --- a/sleekxmpp/plugins/xep_0004/stanza/form.py +++ b/sleekxmpp/plugins/xep_0004/stanza/form.py @@ -159,7 +159,7 @@ class Form(ElementBase): items = [] itemsXML = self.xml.findall('{%s}item' % self.namespace) for itemXML in itemsXML: - item = {} + item = OrderedDict() fieldsXML = itemXML.findall('{%s}field' % FormField.namespace) for fieldXML in fieldsXML: field = FormField(xml=fieldXML) @@ -168,7 +168,7 @@ class Form(ElementBase): return items def get_reported(self): - fields = {} + fields = OrderedDict() xml = self.xml.findall('{%s}reported/{%s}field' % (self.namespace, FormField.namespace)) for field in xml: @@ -177,7 +177,7 @@ class Form(ElementBase): return fields def get_values(self): - values = {} + values = OrderedDict() fields = self['fields'] for var in fields: values[var] = fields[var]['value']