From 75890fa76ba8a89ea01f09f985050a44103b50f6 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Tue, 19 Sep 2017 22:58:40 +0200 Subject: [PATCH] Blindly 'fix' date handling --- main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 1fc3d11..ca08e7f 100644 --- a/main.py +++ b/main.py @@ -35,12 +35,12 @@ def application(env, re): return 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 None - time = args["time"][0] if "time" in args and args["time"] else None + date = args["date"][0] if "date" in args and args["date"] else datetime.datetime.strftime(datetime.datetime.now(),"%d.%m.%Y") + time = args["time"][0] if "time" in args and args["time"] else datetime.datetime.strftime(datetime.datetime.now(),"%H:%M") mode = args["mode"][0] if "mode" in args and args["mode"] else None try: - outtime = datetime.strptime("%s %s" % (date, time), "%d.%m.%Y %H:%M") + outtime = datetime.datetime.strptime("%s %s" % (date, time), "%d.%m.%Y %H:%M") except: re("400 Bad Request", []) yield "

400 Bad Request

".encode() @@ -49,7 +49,6 @@ def application(env, re): try: output = workers.conn.worker(frm, to, count, date, time, mode) - except Exception as e: re("500 Internal Server Error", []) yield "

500 Internal Server Error

".encode()