X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/5c27251fa08566a00d124aaf2c02249995dac9cf..2cc6286f24b7cde25c468b2b4a817e5fa7a9cceb:/lib/python/Components/EventInfo.py diff --git a/lib/python/Components/EventInfo.py b/lib/python/Components/EventInfo.py index 6f6d07ff..e69de29b 100644 --- a/lib/python/Components/EventInfo.py +++ b/lib/python/Components/EventInfo.py @@ -1,44 +0,0 @@ -from PerServiceDisplay import * -from time import strftime -from time import localtime - -from enigma import iServiceInformationPtr, eServiceEventPtr - -class EventInfo(PerServiceDisplay): - Now = 0 - Next = 1 - Now_Duration = 2 - Next_Duration = 3 - Now_StartTime = 4 - Next_StartTime = 5 - - def __init__(self, navcore, now_or_next): - # listen to evUpdatedEventInfo and evStopService - # note that evStopService will be called once to establish a known state - self.now_or_next = now_or_next - PerServiceDisplay.__init__(self, navcore, - { - pNavigation.evUpdatedEventInfo: self.ourEvent, - pNavigation.evStopService: self.stopEvent - }) - - def ourEvent(self): - info = iServiceInformationPtr() - service = self.navcore.getCurrentService() - - if service != None: - info = service.info() - if info is not None: - ev = info.getEvent(self.now_or_next & 1) - if ev is not None: - if (self.Now_Duration <= self.now_or_next <= self.Next_Duration): - self.setText("%d min" % (ev.getDuration() / 60)) - if (self.Now_StartTime <= self.now_or_next <= self.Next_StartTime): - self.setText(strftime("%H:%M", localtime(ev.getBeginTime()))) - if (self.Now <= self.now_or_next <= self.Next): - self.setText(ev.getEventName()) - - def stopEvent(self): - self.setText( - ("waiting for event data...", "", "--:--", "--:--", "--:--", "--:--")[self.now_or_next]); -