aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Timezones.py
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-08-20 10:17:35 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-08-20 10:17:35 +0000
commit080c2a83b79af8afe48105bb0a1b69d3597a2e49 (patch)
treea5b7e6aa33d29b73c5670f291a1ceae8d8b943b3 /lib/python/Components/Timezones.py
parent2e77a8fe974a2b01fee358d16fe76dbfdddfceba (diff)
downloadenigma2-080c2a83b79af8afe48105bb0a1b69d3597a2e49.tar.gz
enigma2-080c2a83b79af8afe48105bb0a1b69d3597a2e49.zip
set /etc/localtime link when change the timezone too
Diffstat (limited to 'lib/python/Components/Timezones.py')
-rw-r--r--lib/python/Components/Timezones.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/python/Components/Timezones.py b/lib/python/Components/Timezones.py
index 6e43aa21..d9edfec5 100644
--- a/lib/python/Components/Timezones.py
+++ b/lib/python/Components/Timezones.py
@@ -1,7 +1,7 @@
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
-import os
+from os import environ, unlink, symlink
import time
class Timezones:
@@ -36,7 +36,12 @@ class Timezones:
if len(self.timezones) <= index:
return
- os.environ['TZ'] = self.timezones[index][1]
+ environ['TZ'] = self.timezones[index][1]
+ try:
+ unlink("/etc/localtime")
+ except OSError:
+ pass
+ symlink("/usr/share/zoneinfo/%s" %(self.timezones[index][1]), "/etc/localtime")
try:
time.tzset()
except: