Fix via station handling

This commit is contained in:
Klaus-Uwe Mitterer 2017-10-02 12:26:19 +02:00
parent 76a4fc8625
commit 479bc58489
2 changed files with 8 additions and 5 deletions

View File

@ -70,8 +70,8 @@ class Connection:
out += " " * indent + " <from>\n"
out += self.depst().xml(indent + 2, **stationkwargs) + "\n"
out += " " * indent + " </from>\n"
if via and self.via:
if via and self.via != 0:
out += " " * indent + " <via>\n"
for vst in self.via:

View File

@ -126,11 +126,14 @@ def connRequest(frm, to, count = 3, time = datetime.datetime.now(), mode = False
# ticketurl = det.find("td", { "class": "fares" }).find("a").get("href")
svc = Service(name, depst, depts, arrst, arrts, currdep = curdep, curarr = curarr)
con = Connection(details)
conn = Connection(details)
con.addService(svc)
for vst in via:
conn.addVia(vst)
yield con
conn.addService(svc)
yield conn
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]))