From 7b3ad3cf348d8558a237eed52145679cc0a601e8 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Fri, 22 Sep 2017 19:00:55 +0200 Subject: [PATCH] Set default result count to 3 --- main.py | 2 +- workers/conn.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 919d311..c1cf6e6 100644 --- a/main.py +++ b/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 diff --git a/workers/conn.py b/workers/conn.py index a425653..464b197 100644 --- a/workers/conn.py +++ b/workers/conn.py @@ -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 %i -""" % (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