add Combine converter (not yet usable from skin), to combine two sources into a result
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 21 May 2009 02:09:41 +0000 (04:09 +0200)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 21 May 2009 02:09:41 +0000 (04:09 +0200)
lib/python/Components/Converter/Combine.py [new file with mode: 0644]
lib/python/Components/Converter/Makefile.am

diff --git a/lib/python/Components/Converter/Combine.py b/lib/python/Components/Converter/Combine.py
new file mode 100644 (file)
index 0000000..35f4d0e
--- /dev/null
@@ -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)
index 331a6dc0f10cdd425baaf6aeec4ab8d7b17f4675..da226f82d08c0c92e1bc9e14c23f7ca00dcb746c 100644 (file)
@@ -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