add handleCommand to converter
[enigma2.git] / lib / python / Components / Converter / ServiceName.py
index 77647dd05dd40fc14a66b6f585f5455254f39aa6..7c463a62162fd87cc3120a41fe360a0b2175d6d4 100644 (file)
@@ -1,12 +1,13 @@
 from Components.Converter.Converter import Converter
 from enigma import iServiceInformation, iPlayableService
+from Components.Element import cached
 
 class ServiceName(Converter, object):
        NAME = 0
        PROVIDER = 1
 
-       def __init__(self, type, *args, **kwargs):
-               Converter.__init__(self)
+       def __init__(self, type):
+               Converter.__init__(self, type)
                if type == "Provider":
                        self.type = self.PROVIDER
                else:
@@ -18,6 +19,7 @@ class ServiceName(Converter, object):
                        return "N/A"
                return info.getInfoString(what)
 
+       @cached
        def getText(self):
                service = self.source.service
                info = service and service.info()
@@ -31,6 +33,6 @@ class ServiceName(Converter, object):
 
        text = property(getText)
 
-       def changed(self, *args):
-               if not len(args) or args[0] in [iPlayableService.evStart, iPlayableService.evEnd]:
-                       Converter.changed(self)
+       def changed(self, what):
+               if what[0] != self.CHANGED_SPECIFIC or what[1] in [iPlayableService.evStart]:
+                       Converter.changed(self, what)