add simple event source
[enigma2.git] / lib / python / Components / Sources / Event.py
1 from Components.VariableText import VariableText
2 from Components.GUIComponent import GUIComponent
3 from enigma import eEPGCache, eServiceReference as Ref, eLabel
4 from Source import Source
5
6 class Event(VariableText, GUIComponent, Source, object):
7         def __init__(self, timer=None):
8                 Source.__init__(self)
9                 GUIComponent.__init__(self)
10                 VariableText.__init__(self)
11                 self.event = None
12
13         GUI_WIDGET = eLabel
14
15         def getCurrentEvent(self):
16                 return self.event
17
18         event = property(getCurrentEvent)
19
20         def newEvent(self, event):
21                 if not self.event or self.event != event:
22                         self.event = event
23                         if not event:
24                                 self.changed((self.CHANGED_CLEAR,))
25                         else:
26                                 self.changed((self.CHANGED_ALL,))