From fad54a64728fefa4cd4f2aa89efb416dbce9ba3f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 2 Jun 2023 20:40:30 +0200 Subject: [PATCH] Made timezone configurable --- config.ini | 1 + game.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.ini b/config.ini index 1b3555a..d34aeac 100644 --- a/config.ini +++ b/config.ini @@ -2,3 +2,4 @@ title = A oder B separator = oder separator_char = ; +timezone = Europe/Berlin diff --git a/game.py b/game.py index ca57c54..233e62f 100755 --- a/game.py +++ b/game.py @@ -16,7 +16,7 @@ config = ConfigParser() config.read('config.ini') logging.basicConfig(encoding='utf-8', level=logging.INFO, format='%(message)s') logger = logging.getLogger('waitress') -tz = pytz.timezone('Europe/Berlin') +tz = pytz.timezone(config.get('main', 'timezone') @app.after_request def log_the_request(response): @@ -57,7 +57,6 @@ def log_the_request(response): logfile = "{} - {} [{}] \"{} {}\" {} {} \"{}\" \"{}\"".format(log['remote_addr'], log['remote_user'], log['date'], log['method'], log['url'], log['status_code'], log['content_length'], log['referrer'], log['user_agent']) logger.info(logfile) - return response @app.route("/")