Skip to content
Snippets Groups Projects
Commit f7290514 authored by Campos Cordobes, Sergio's avatar Campos Cordobes, Sergio
Browse files

Update configuration.py. getconfigurationfile returns a json, instead of xml

parent effb6614
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,11 @@ Created on: 16/01/2023
"""
import math
import json
import xmltodict
import sys
print(sys.path)
from src import constants, utils
......@@ -102,21 +107,23 @@ def getconfigurationfile(cnx, request):
city = request.args.get("city", default=None, type=str)
if (city=="BIO"):
fichero = open('kpis_bilbao.dex')
ret_json = fichero.read()
ret_xml = fichero.read()
if (city=="AMS"):
fichero = open('kpis_amsterdam.dex')
ret_json = fichero.read()
ret_xml = fichero.read()
if (city=="HEL"):
fichero = open('kpis_helsinki.dex')
ret_json = fichero.read()
ret_xml = fichero.read()
if (city=="MES"):
fichero = open('kpis_messina.dex')
ret_json = fichero.read()
ret_xml = fichero.read()
data_dict = xmltodict.parse(ret_xml)
ret_json = json.dumps(data_dict)
return ret_json
except:
return constants.ERROR_EXCEPTION
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment