Commit 609194dd authored by Klaus-Uwe Mitterer's avatar Klaus-Uwe Mitterer

Invert connection list (i.e. latest first) if searching for connections by arrival time

parent 4b5a4516
......@@ -92,7 +92,7 @@ def getDetails(cid, url, q, via = [], eq = None):
iq = queue.PriorityQueue()
for line in range(0, len(lines), 3):
t = threading.Thread(target=getService, args=(line, lines[line:line + 3], iq, eq))
t = threading.Thread(target=getService, args=(line, lines[line:line + 3], iq, eq), daemon = True)
t.start()
threads += [t]
......@@ -158,7 +158,7 @@ def connRequest(frm, to, count = 3, time = datetime.datetime.now(), mode = False
q = queue.PriorityQueue()
for i in range(len(conns)):
t = threading.Thread(target=getDetails, args=(i, conns[i], q, via, eq))
t = threading.Thread(target=getDetails, args=(i, conns[i], q, via, eq), daemon = True)
t.start()
threads += [t]
......@@ -216,6 +216,7 @@ def connRequest(frm, to, count = 3, time = datetime.datetime.now(), mode = False
def worker(frm, to, count = 3, time = datetime.datetime.now(pytz.timezone("Europe/Vienna")), mode = False, details = False, json = False, via = None):
conns = list(connRequest(getStation(frm), getStation(to), count, time, mode, details, [getStation(vst) for vst in via] if via else []))
conns = conns[::-1] if mode else conns
output = """<?xml version="1.0" encoding="UTF-8"?>
<connections>
......
......@@ -75,7 +75,7 @@ def daRequest(station, count = 3, time = datetime.datetime.now(), mode = False,
q = queue.PriorityQueue()
for i in range(len(services)):
t = threading.Thread(target=getService, args=(i, services[i][0], services[i][1], q, eq))
t = threading.Thread(target=getService, args=(i, services[i][0], services[i][1], q, eq), daemon = True)
t.start()
threads += [t]
......
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