aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Converter/ValueBitTest.py
diff options
context:
space:
mode:
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)