add ServiceReference to ServiceName converter, event id to EventName (patch by reichi)
authorFelix Domke <tmbinc@elitedvb.net>
Wed, 6 Jun 2007 14:16:16 +0000 (14:16 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Wed, 6 Jun 2007 14:16:16 +0000 (14:16 +0000)
lib/python/Components/Converter/EventName.py
lib/python/Components/Converter/ServiceName.py

index 919dd3b..051e1ea 100644 (file)
@@ -5,13 +5,16 @@ class EventName(Converter, object):
        NAME = 0
        SHORT_DESCRIPTION = 1
        EXTENDED_DESCRIPTION = 2
-
+       ID = 3
+       
        def __init__(self, type):
                Converter.__init__(self, type)
                if type == "Description":
                        self.type = self.SHORT_DESCRIPTION
                elif type == "ExtendedDescription":
                        self.type = self.EXTENDED_DESCRIPTION
+               elif type == "ID":
+                       self.type = self.ID
                else:
                        self.type = self.NAME
 
@@ -27,5 +30,7 @@ class EventName(Converter, object):
                        return event.getShortDescription()
                elif self.type == self.EXTENDED_DESCRIPTION:
                        return event.getExtendedDescription()
-                       
+               elif self.type == self.ID:
+                       return str(event.getEventId())
+               
        text = property(getText)
index 9ccbda5..fcabe42 100644 (file)
@@ -6,11 +6,14 @@ from Components.Element import cached
 class ServiceName(Converter, object):
        NAME = 0
        PROVIDER = 1
+       REFERENCE = 2
 
        def __init__(self, type):
                Converter.__init__(self, type)
                if type == "Provider":
                        self.type = self.PROVIDER
+               elif type == "Reference":
+                       self.type = self.REFERENCE
                else:
                        self.type = self.NAME
 
@@ -31,7 +34,9 @@ class ServiceName(Converter, object):
                        return info.getName().replace('\xc2\x86', '').replace('\xc2\x87', '')
                elif self.type == self.PROVIDER:
                        return self.getServiceInfoValue(info, iServiceInformation.sProvider)
-
+               elif self.type == self.REFERENCE:
+                       return self.getServiceInfoValue(info, iServiceInformation.sServiceref)
+               
        text = property(getText)
 
        def changed(self, what):