Merge commit 'origin/bug_112_enable_extensions_manager' into experimental
[enigma2.git] / lib / python / Components / Converter / TunerInfo.py
1 from Components.Sources.TunerInfo import TunerInfo as TunerInfoSource
2 from Components.Converter.Converter import Converter
3 from Components.Element import cached
4
5 class TunerInfo(Converter, object):
6         def __init__(self, type):
7                 Converter.__init__(self, type)
8                 self.type = {
9                                 "TunerUseMask": TunerInfoSource.FE_USE_MASK
10                         }[type]
11
12         @cached
13         def getBoolean(self):
14                 if self.type == TunerInfoSource.FE_USE_MASK:
15                         return self.source.getTunerUseMask() and True or False
16         boolean = property(getBoolean)
17
18         @cached
19         def getText(self):
20                 if self.type == TunerInfoSource.FE_USE_MASK:
21                         return str(self.source.getTunerUseMask())
22                 return ""
23         text = property(getText)
24
25         @cached
26         def getValue(self):
27                 if self.type == TunerInfoSource.FE_USE_MASK:
28                         return self.source.getTunerUseMask()
29                 return -1
30         value = property(getValue)
31
32         def changed(self, what):
33                 if what[0] != self.CHANGED_SPECIFIC or what[1] == self.type:
34                         Converter.changed(self, what)