e4499950c88a84be68ec13397576be6779572d18
[enigma2.git] / lib / python / Components / Converter / RadioText.py
1 from Components.Converter.Converter import Converter
2 from Components.Element import cached
3
4 class RadioText(Converter, object):
5         def __init__(self, type):
6                 Converter.__init__(self, type)
7                 self.type = type
8
9         @cached
10         def getText(self):
11                 rt = self.source.radiotext
12                 if rt is None:
13                         return "N/A"
14                 text = rt.getRadioText()
15                 if self.type == "RadioText-UTF8":
16                         return text.decode("latin-1").encode("utf-8")
17                 else:
18                         return text
19         text = property(getText)