From: Andreas Monzner Date: Thu, 1 Nov 2007 23:35:40 +0000 (+0000) Subject: add new component ValueTestBit to make bit tests X-Git-Tag: 2.6.0~1775 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/286db3502b14cec4cc7706a04684f4a1a289a5a7?ds=sidebyside add new component ValueTestBit to make bit tests --- diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am index 46aac523..b1dc1416 100644 --- a/lib/python/Components/Converter/Makefile.am +++ b/lib/python/Components/Converter/Makefile.am @@ -4,4 +4,5 @@ install_PYTHON = \ __init__.py ClockToText.py Converter.py EventName.py StaticText.py EventTime.py \ 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 + StaticMultiList.py ServiceTime.py MovieInfo.py MenuEntryCompare.py StringListSelection.py \ + ValueBitTest.py Global.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)