refs bug #429
[enigma2.git] / lib / python / Components / Timezones.py
index d9edfec..7f70915 100644 (file)
@@ -41,7 +41,10 @@ class Timezones:
                        unlink("/etc/localtime")
                except OSError:
                        pass
-               symlink("/usr/share/zoneinfo/%s" %(self.timezones[index][1]), "/etc/localtime")
+               try:
+                       symlink("/usr/share/zoneinfo/%s" %(self.timezones[index][1]), "/etc/localtime")
+               except OSError:
+                       pass
                try:
                        time.tzset()
                except:
@@ -49,11 +52,8 @@ class Timezones:
                        e_tzset()
                
        def getTimezoneList(self):
-               list = []
-               for x in self.timezones:
-                       list.append(str(x[0]))
-               return list
-       
+               return [ str(x[0]) for x in self.timezones ]
+
        def getDefaultTimezone(self):
                # TODO return something more useful - depending on country-settings?
                t = "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Vienna"