1 from PerServiceDisplay import *
2 from time import strftime
3 from time import localtime
5 from enigma import iServiceInformationPtr, eServiceEventPtr
7 class EventInfo(PerServiceDisplay):
15 def __init__(self, navcore, now_or_next):
16 # listen to evUpdatedEventInfo and evStopService
17 # note that evStopService will be called once to establish a known state
18 self.now_or_next = now_or_next
19 PerServiceDisplay.__init__(self, navcore,
21 pNavigation.evUpdatedEventInfo: self.ourEvent,
22 pNavigation.evStopService: self.stopEvent
26 info = iServiceInformationPtr()
27 service = self.navcore.getCurrentService()
32 ev = info.getEvent(self.now_or_next & 1)
34 if (self.Now_Duration <= self.now_or_next <= self.Next_Duration):
35 self.setText("%d min" % (ev.getDuration() / 60))
36 if (self.Now_StartTime <= self.now_or_next <= self.Next_StartTime):
37 self.setText(strftime("%H:%M", localtime(ev.getBeginTime())))
38 if (self.Now <= self.now_or_next <= self.Next):
39 self.setText(ev.getEventName())
43 #(_("waiting for event data..."), "", "--:--", "--:--", "--:--", "--:--")[self.now_or_next]);
44 ("", "", "--:--", "--:--", "--:--", "--:--")[self.now_or_next]);