some fixes for dvb-s2
[enigma2.git] / lib / python / Components / ServiceEventTracker.py
1 from enigma import pNavigation
2
3 class ServiceEventTracker:
4         """Tracks service events into a screen"""
5         
6         def __init__(self, screen, eventmap):
7                 self.__eventmap = eventmap
8                 self.session = screen.session
9                 self.session.nav.event.append(self.__event)
10                 screen.onClose.append(self.__del_event)
11
12         def __del_event(self):
13                 self.session.nav.event.remove(self.__event)
14
15         def __event(self, ev):
16                 if ev in self.__eventmap:
17                         self.__eventmap[ev]()