Commit d1d71065 authored by Rafael Monnerat's avatar Rafael Monnerat

Revert method removal

This method was used by another function
parent 7795067c
......@@ -12,6 +12,21 @@ DB_VERSION = app.open_resource('schema.sql').readline().strip().split(':')[1]
class UnauthorizedError(Exception):
pass
def xml2dict(xml):
result_dict = {}
if xml is not None and xml != '':
tree = etree.fromstring(xml.encode('utf-8'))
for element in tree.iter(tag=etree.Element):
if element.tag == 'parameter':
key = element.get('id')
value = result_dict.get(key, None)
if value is not None:
value = value + ' ' + element.text
else:
value = element.text
result_dict[key] = value
return result_dict
def partitiondict2partition(partition):
# XXX-Cedric : change function name, as it does no longer create a
# Partition instance, but rather create a dict ready to be sent in json
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment