diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-07-27 22:18:41 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-07-27 22:18:41 +0000 |
| commit | f925e1fc04e179b6626c47170700159ae4212d93 (patch) | |
| tree | 9b6f160b7219540b3419e05929fbdcc3a743d1ed /lib/python | |
| parent | a1a2ae77b09ebcbd9f74a45d6e403c306eb1ea7f (diff) | |
| download | enigma2-f925e1fc04e179b6626c47170700159ae4212d93.tar.gz enigma2-f925e1fc04e179b6626c47170700159ae4212d93.zip | |
add simple event source
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/Sources/Event.py | 26 | ||||
| -rw-r--r-- | lib/python/Components/Sources/Makefile.am | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/lib/python/Components/Sources/Event.py b/lib/python/Components/Sources/Event.py new file mode 100644 index 00000000..7b589d92 --- /dev/null +++ b/lib/python/Components/Sources/Event.py @@ -0,0 +1,26 @@ +from Components.VariableText import VariableText +from Components.GUIComponent import GUIComponent +from enigma import eEPGCache, eServiceReference as Ref, eLabel +from Source import Source + +class Event(VariableText, GUIComponent, Source, object): + def __init__(self, timer=None): + Source.__init__(self) + GUIComponent.__init__(self) + VariableText.__init__(self) + self.event = None + + GUI_WIDGET = eLabel + + def getCurrentEvent(self): + return self.event + + event = property(getCurrentEvent) + + def newEvent(self, event): + if not self.event or self.event != event: + self.event = event + if not event: + self.changed((self.CHANGED_CLEAR,)) + else: + self.changed((self.CHANGED_ALL,)) diff --git a/lib/python/Components/Sources/Makefile.am b/lib/python/Components/Sources/Makefile.am index 43efcf5c..0ac22bf4 100644 --- a/lib/python/Components/Sources/Makefile.am +++ b/lib/python/Components/Sources/Makefile.am @@ -3,4 +3,4 @@ installdir = $(LIBDIR)/enigma2/python/Components/Sources install_PYTHON = \ __init__.py Clock.py EventInfo.py Source.py List.py CurrentService.py \ FrontendStatus.py Boolean.py Config.py ServiceList.py RdsDecoder.py StreamService.py \ - StaticText.py CanvasSource.py ServiceEvent.py + StaticText.py CanvasSource.py ServiceEvent.py Event.py |
