tools (xml_tools): keeps data form result headers sorted

This commit is contained in:
souliane 2015-08-26 12:24:38 +02:00
commit 56dc4840a6

View file

@ -27,6 +27,7 @@ from wokkel import data_form
from twisted.words.xish import domish from twisted.words.xish import domish
from twisted.words.protocols.jabber import jid from twisted.words.protocols.jabber import jid
from sat.core import exceptions from sat.core import exceptions
from collections import OrderedDict
"""This library help manage XML used in SàT (parameters, registration, etc)""" """This library help manage XML used in SàT (parameters, registration, etc)"""
@ -141,7 +142,7 @@ def dataFormResult2AdvancedList(xmlui, form_xml):
@param form_xml (domish.Element): element of the data form @param form_xml (domish.Element): element of the data form
@return: the completed XMLUI instance @return: the completed XMLUI instance
""" """
headers = {} headers = OrderedDict()
try: try:
reported_elt = form_xml.elements('jabber:x:data', 'reported').next() reported_elt = form_xml.elements('jabber:x:data', 'reported').next()
except StopIteration: except StopIteration: