diff options
Diffstat (limited to 'textw/timezone.py')
-rw-r--r-- | textw/timezone.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/textw/timezone.py b/textw/timezone.py index e776c0121..99f8165b8 100644 --- a/textw/timezone.py +++ b/textw/timezone.py @@ -45,8 +45,11 @@ class TimezoneWindow: self.updateClock() def updateClock(self): - os.environ['TZ'] = self.l.current() - self.label.setText(self.currentTime()) + if os.access("/usr/share/zoneinfo/" + self.l.current(), os.R_OK): + os.environ['TZ'] = self.l.current() + self.label.setText(self.currentTime()) + else: + self.label.setText("") def currentTime(self): return "Current time: " + strftime("%X %Z", localtime(time())) @@ -89,7 +92,7 @@ class TimezoneWindow: while result == "TIMER": result = self.g.run() if result == "TIMER": - self.label.setText(self.currentTime()) + self.updateClock() screen.popWindow() |