diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-11-01 23:35:40 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-11-01 23:35:40 +0000 |
| commit | 286db3502b14cec4cc7706a04684f4a1a289a5a7 (patch) | |
| tree | 4d8d1526a33540cec6afc6584d56e10f3639788b /lib/python/Components/Converter/ValueBitTest.py | |
| parent | 3f5acc5cef5475cef339c967f8ca7da54b1625e3 (diff) | |
| download | enigma2-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.py | 13 |
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) |
