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()