Allow latitude and longitude to be passed using a decimal comma
This commit is contained in:
parent
d43138016c
commit
308f30d223
4
main.py
4
main.py
|
@ -130,8 +130,8 @@ def application(env, re):
|
||||||
|
|
||||||
elif rtype.lower() in ["closest", "close", "near", "nearby"]:
|
elif rtype.lower() in ["closest", "close", "near", "nearby"]:
|
||||||
try:
|
try:
|
||||||
lat = float(args["lat"][0])
|
lat = float(args["lat"][0].replace(",", "."))
|
||||||
lon = float(args["lon"][0])
|
lon = float(args["lon"][0].replace(",", "."))
|
||||||
|
|
||||||
if (not lat and not lat == float(0)) or (not lon and not lon == float(0)):
|
if (not lat and not lat == float(0)) or (not lon and not lon == float(0)):
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
|
|
|
@ -135,7 +135,7 @@ def worker(frm, to, count = 3, time = datetime.datetime.now(pytz.timezone("Europ
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for i in range(len(conns)):
|
for i in range(len(conns)):
|
||||||
output += (conns[i].xml(1) + "\n") if not json else (conns[i].json(2) + ("\n" if i == len(conns) - 1 else ",\n"))
|
output += (conns[i].xml(1, i) + "\n") if not json else (conns[i].json(2, i) + ("\n" if i == len(conns) - 1 else ",\n"))
|
||||||
|
|
||||||
output += "</connections>" if not json else " ]\n}"
|
output += "</connections>" if not json else " ]\n}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue