don't crash if time is *really* invalid
[enigma2.git] / lib / python / Components / ServicePosition.py
index 467a80e3161778f61a1f6ea5b78b4eaf0963fad8..ba87e3ef680df8438255f6a9a38352115d41a18b 100644 (file)
@@ -65,8 +65,11 @@ class ServicePosition(PerServiceDisplay):
                                l = self.get(self.TYPE_POSITION)
                                if l != -1:
                                        l += self.relative_base
                                l = self.get(self.TYPE_POSITION)
                                if l != -1:
                                        l += self.relative_base
-                                       t = time.localtime(l)
-                                       timestr = "%2d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec)
+                                       try:
+                                               t = time.localtime(l)
+                                               timestr = "%2d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec)
+                                       except ValueError:
+                                               timestr = ""
                                else:
                                        timestr = ""
 
                                else:
                                        timestr = ""
 
@@ -123,13 +126,11 @@ class ServicePositionGauge(PerServiceBase):
        def stopEvent(self):
                self.disablePolling()
 
        def stopEvent(self):
                self.disablePolling()
 
-       def GUIcreate(self, parent):
-               self.instance = ePositionGauge(parent)
+       GUI_WIDGET = ePositionGauge
+       
+       def postWidgetCreate(self, instance):
                self.newService()
        
                self.newService()
        
-       def GUIdelete(self):
-               self.instance = None
-
        def newCuesheet(self):
                service = self.navcore.getCurrentService()
                cue = service and service.cueSheet()
        def newCuesheet(self):
                service = self.navcore.getCurrentService()
                cue = service and service.cueSheet()