Set default result count to 3
This commit is contained in:
parent
caca14c66a
commit
7b3ad3cf34
2
main.py
2
main.py
|
@ -37,7 +37,7 @@ def application(env, re):
|
|||
yield "\"from\" and \"to\" values are required for this type of request.".encode()
|
||||
return
|
||||
|
||||
count = args["count"][0] if "count" in args and args["count"] else 1
|
||||
count = args["count"][0] if "count" in args and args["count"] else 3
|
||||
date = args["date"][0] if "date" in args and args["date"] else datetime.datetime.strftime(datetime.datetime.now(pytz.timezone("Europe/Vienna")),"%d.%m.%Y")
|
||||
time = args["time"][0] if "time" in args and args["time"] else datetime.datetime.strftime(datetime.datetime.now(pytz.timezone("Europe/Vienna")),"%H:%M")
|
||||
mode = True if "mode" in args and args["mode"] and args["mode"][0].lower() == "arr" else False
|
||||
|
|
|
@ -96,7 +96,7 @@ def connRequest(frm, to, count = 3, time = datetime.datetime.now(), mode = False
|
|||
depst = getStation(stations[0].text.strip())
|
||||
arrst = getStation(stations[-1].text.strip())
|
||||
|
||||
dates = det.find("td", { "class": "date" }).text.split()
|
||||
dates = list(det.find("td", { "class": "date" }).strings)
|
||||
depdate = dates[0]
|
||||
try:
|
||||
arrdate = dates[1]
|
||||
|
@ -167,7 +167,7 @@ def worker(frm, to, count = 3, time = datetime.datetime.now(pytz.timezone("Europ
|
|||
<changes>%i</changes>
|
||||
</details>
|
||||
<services>
|
||||
""" % (i, conn.depst().name, conn.depst().useId(), conn.arrst().name, conn.arrst().useId(), ddt, dtm, adt, atm, "%i:%i" % (hrs, mns), chg)
|
||||
""" % (i, conn.depst().name, conn.depst().useId(), conn.arrst().name, conn.arrst().useId(), ddt, dtm, adt, atm, "%i:%s" % (hrs, str(int(mns)).zfill(2)), chg)
|
||||
|
||||
j = 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue