Skip to content

Commit

Permalink
Fer el codi pensant un dijendres a les 18:30
Browse files Browse the repository at this point in the history
  • Loading branch information
eberloso committed Sep 10, 2020
1 parent cba5e68 commit 4597019
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion gestionatr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,20 @@ def request_p0(url, user, password, xml_file):
# Send request
res = client.service.sync(xml_str)
try:
def find_child(element, child_name):
res = None
if child_name in element.tag:
return element
for child in element:
res = find_child(child, child_name)
if res:
break
return res

aux = etree.fromstring(res)
res = etree.tostring(aux[0][0][0][0])
aux_res = find_child(aux, "MensajeEnvioInformacionPS")

res = etree.tostring(aux_res)
except Exception:
pass
return res
Expand Down

0 comments on commit 4597019

Please sign in to comment.