X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c0d78035b8c76e719bf7c05ff3812eb5a6ce9fe3..cedcadfd77539c39e928a6d5cc4fcd8d1cf48ac8:/lib/python/Components/ServicePosition.py diff --git a/lib/python/Components/ServicePosition.py b/lib/python/Components/ServicePosition.py index cb444921..f5771e3a 100644 --- a/lib/python/Components/ServicePosition.py +++ b/lib/python/Components/ServicePosition.py @@ -1,4 +1,5 @@ from PerServiceDisplay import PerServiceDisplay, PerServiceBase +from Components.GUIComponent import GUIComponent from enigma import eTimer, iPlayableService, iSeekableServicePtr, ePositionGauge import time @@ -65,8 +66,11 @@ class ServicePosition(PerServiceDisplay): 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 = "" @@ -81,8 +85,9 @@ class ServicePosition(PerServiceDisplay): self.updateTimer.stop() self.setText(""); -class ServicePositionGauge(PerServiceBase): +class ServicePositionGauge(PerServiceBase, GUIComponent): def __init__(self, navcore): + GUIComponent.__init__(self) PerServiceBase.__init__(self, navcore, { iPlayableService.evStart: self.newService,