X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/2e874fa14264bf37f17ae9b9375e26059e7f35ec..c3f3135726277c4030e0049fc6ab774ba81c706a:/lib/python/Components/Converter/EventTime.py diff --git a/lib/python/Components/Converter/EventTime.py b/lib/python/Components/Converter/EventTime.py index 3c312a69..966f2ca8 100644 --- a/lib/python/Components/Converter/EventTime.py +++ b/lib/python/Components/Converter/EventTime.py @@ -1,6 +1,7 @@ from Converter import Converter from Poll import Poll from time import time +from Components.Element import cached class EventTime(Poll, Converter, object): STARTTIME = 0 @@ -9,8 +10,8 @@ class EventTime(Poll, Converter, object): PROGRESS = 3 DURATION = 4 - def __init__(self, type, *args, **kwargs): - Converter.__init__(self) + def __init__(self, type): + Converter.__init__(self, type) Poll.__init__(self) if type == "EndTime": self.type = self.ENDTIME @@ -27,8 +28,9 @@ class EventTime(Poll, Converter, object): self.poll_interval = 30*1000 self.poll_enabled = True else: - raise str("'%s' is not for EventTime converter" % type) + raise str("'%s' is not for EventTime converter" % type) + @cached def getTime(self): assert self.type != self.PROGRESS @@ -52,6 +54,7 @@ class EventTime(Poll, Converter, object): else: return (duration, None) + @cached def getValue(self): assert self.type == self.PROGRESS @@ -70,3 +73,11 @@ class EventTime(Poll, Converter, object): time = property(getTime) value = property(getValue) range = 1000 + + def changed(self, what): + Converter.changed(self, what) + if self.type == self.PROGRESS and len(self.downstream_elements): + if not self.source.event and self.downstream_elements[0].visible: + self.downstream_elements[0].visible = False + elif self.source.event and not self.downstream_elements[0].visible: + self.downstream_elements[0].visible = True