show radio (rds) text when available... feel free to make it nicer
[enigma2.git] / lib / python / Components / Converter / RadioText.py
diff --git a/lib/python/Components/Converter/RadioText.py b/lib/python/Components/Converter/RadioText.py
new file mode 100644 (file)
index 0000000..77ec58e
--- /dev/null
@@ -0,0 +1,15 @@
+from Components.Converter.Converter import Converter
+from Components.Element import cached
+
+class RadioText(Converter, object):
+       def __init__(self, type):
+               Converter.__init__(self, type)
+
+       @cached
+       def getText(self):
+               rt = self.source.radiotext
+               if rt is None:
+                       return "N/A"
+               return rt
+
+       text = property(getText)