1 from PerServiceDisplay import *
3 class EventInfo(PerServiceDisplay):
9 def __init__(self, navcore, now_or_next):
10 # listen to evUpdatedEventInfo and evStopService
11 # note that evStopService will be called once to establish a known state
12 self.now_or_next = now_or_next
13 PerServiceDisplay.__init__(self, navcore,
15 pNavigation.evUpdatedEventInfo: self.ourEvent,
16 pNavigation.evStopService: self.stopEvent
20 info = iServiceInformationPtr()
21 service = self.navcore.getCurrentService()
24 if not service.info(info):
25 ev = eServiceEventPtr()
26 if info.getEvent(ev, self.now_or_next & 1) == 0:
27 if self.now_or_next & 2:
28 self.setText("%d min" % (ev.m_duration / 60))
30 self.setText(ev.m_event_name)
31 print "new event info in EventInfo! yeah!"
35 ("waiting for event data...", "", "--:--", "--:--")[self.now_or_next]);