summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-12-13 09:00:45 -0800
committerLance Stout <lancestout@gmail.com>2011-12-13 09:00:45 -0800
commit116bb6e1b9e5c9d067b2a522d595eaa75e31be6b (patch)
tree8266c27ab42910cd867a8ce2e8eb839a789d0948 /sleekxmpp/plugins
parent9c6dde5d22badadb318ca8f340b592c63944c975 (diff)
downloadslixmpp-116bb6e1b9e5c9d067b2a522d595eaa75e31be6b.tar.gz
slixmpp-116bb6e1b9e5c9d067b2a522d595eaa75e31be6b.tar.bz2
slixmpp-116bb6e1b9e5c9d067b2a522d595eaa75e31be6b.tar.xz
slixmpp-116bb6e1b9e5c9d067b2a522d595eaa75e31be6b.zip
Use OrderedDicts instead of regular dictionaries when returning values from forms.
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0004/stanza/form.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sleekxmpp/plugins/xep_0004/stanza/form.py b/sleekxmpp/plugins/xep_0004/stanza/form.py
index 1fcd707f..bbf0ee7d 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']