From 286db3502b14cec4cc7706a04684f4a1a289a5a7 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 1 Nov 2007 23:35:40 +0000 Subject: add new component ValueTestBit to make bit tests --- lib/python/Components/Converter/ValueBitTest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/python/Components/Converter/ValueBitTest.py (limited to 'lib/python/Components/Converter/ValueBitTest.py') 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) -- cgit v1.2.3