aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Converter/ValueBitTest.py
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-11-01 23:35:40 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-11-01 23:35:40 +0000
commit286db3502b14cec4cc7706a04684f4a1a289a5a7 (patch)
tree4d8d1526a33540cec6afc6584d56e10f3639788b /lib/python/Components/Converter/ValueBitTest.py
parent3f5acc5cef5475cef339c967f8ca7da54b1625e3 (diff)
downloadenigma2-286db3502b14cec4cc7706a04684f4a1a289a5a7.tar.gz
enigma2-286db3502b14cec4cc7706a04684f4a1a289a5a7.zip
add new component ValueTestBit to make bit tests
Diffstat (limited to 'lib/python/Components/Converter/ValueBitTest.py')
-rw-r--r--lib/python/Components/Converter/ValueBitTest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/ValueBitTest.py b/lib/python/Components/Converter/ValueBitTest.py
new file mode 100644
index 00000000..b53a8fcb
--- /dev/null
+++ b/lib/python/Components/Converter/ValueBitTest.py
@@ -0,0 +1,13 @@
+from Converter import Converter
+from Components.Element import cached
+
+class ValueBitTest(Converter, object):
+ def __init__(self, arg):
+ Converter.__init__(self, arg)
+ self.value = int(arg)
+
+ @cached
+ def getBoolean(self):
+ return self.source.value & self.value and True or False
+
+ boolean = property(getBoolean)