From 472b182ab88318e7957ef24352353561f1503628 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 2 Jan 2020 13:50:15 +0100 Subject: [PATCH] Revert "Use pytz to figure out local timezone dynamically" This reverts commit c19de638a1abd8a5db0e8537dfb92db5583f7fa9. --- bumblebee/modules/datetime.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/bumblebee/modules/datetime.py b/bumblebee/modules/datetime.py index aba0e9a..8899c4a 100644 --- a/bumblebee/modules/datetime.py +++ b/bumblebee/modules/datetime.py @@ -15,11 +15,6 @@ from __future__ import absolute_import import datetime import locale import bumblebee.engine -import os -try: - import pytz -except ModuleNotFoundError: - pytz = None def default_format(module): default = "%x %X" @@ -46,15 +41,8 @@ class Module(bumblebee.engine.Module): locale.setlocale(locale.LC_TIME, ('en_US', 'UTF-8')) def get_time(self, widget): - if pytz: - # Get local timezone (see https://github.com/tobi-wan-kenobi/bumblebee-status/issues/468) - my_tz_name = '/'.join(os.path.realpath('/etc/localtime').split('/')[-2:]) - my_tz = pytz.timezone(my_tz_name) - else: - my_tz = None - enc = locale.getpreferredencoding() - retval = datetime.datetime.now(my_tz).strftime(self._fmt) + retval = datetime.datetime.now().strftime(self._fmt) if hasattr(retval, "decode"): return retval.decode(enc) return retval