aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2009-05-21 04:09:41 +0200
committerFelix Domke <tmbinc@elitedvb.net>2009-05-21 04:09:41 +0200
commit9e2a684354ba693158d4dc04fa17a5f0ea013991 (patch)
treed57fd260db319e48e2e80ab3c0d2d8ff21c83130 /lib/python/Components
parentaa63e716977d5f341495cf0694b327116b978f89 (diff)
downloadenigma2-9e2a684354ba693158d4dc04fa17a5f0ea013991.tar.gz
enigma2-9e2a684354ba693158d4dc04fa17a5f0ea013991.zip
add Combine converter (not yet usable from skin), to combine two sources into a result
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/Converter/Combine.py16
-rw-r--r--lib/python/Components/Converter/Makefile.am3
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/python/Components/Converter/Combine.py b/lib/python/Components/Converter/Combine.py
new file mode 100644
index 00000000..35f4d0ef
--- /dev/null
+++ b/lib/python/Components/Converter/Combine.py
@@ -0,0 +1,16 @@
+from Converter import Converter
+from Components.Element import cached
+
+class Combine(Converter, object):
+ SINGLE_SOURCE = False
+
+ def __init__(self, arg = None, func = None):
+ Converter.__init__(self, arg)
+ assert func is not None
+ self.func = func
+
+ @cached
+ def getValue(self):
+ return self.func(self.sources)
+
+ value = property(getValue)
diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am
index 331a6dc0..da226f82 100644
--- a/lib/python/Components/Converter/Makefile.am
+++ b/lib/python/Components/Converter/Makefile.am
@@ -5,4 +5,5 @@ install_PYTHON = \
Poll.py RemainingToText.py StringList.py ServiceName.py FrontendInfo.py ServiceInfo.py \
ConditionalShowHide.py ServicePosition.py ValueRange.py RdsInfo.py Streaming.py \
StaticMultiList.py ServiceTime.py MovieInfo.py MenuEntryCompare.py StringListSelection.py \
- ValueBitTest.py TunerInfo.py ConfigEntryTest.py TemplatedMultiContent.py ProgressToText.py \ No newline at end of file
+ ValueBitTest.py TunerInfo.py ConfigEntryTest.py TemplatedMultiContent.py ProgressToText.py \
+ Combine.py