show event information of current selected event in channelselection
[enigma2.git] / lib / python / Components / Converter / EventName.py
index f128133a7b7bc2c76e34c4f0aa64d170c48e481b..b1ec62d0c8a643a3f45f8c482c9eaa268b5b5bb8 100644 (file)
@@ -1,28 +1,28 @@
 from Components.Converter.Converter import Converter
+from Components.Element import cached
 
 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
 
+       @cached
        def getText(self):
-               if self.cache is None:
-                       self.cache = self.__getText()
-               return self.cache
-
-       def __getText(self):
                event = self.source.event
                if event is None:
-                       return "N/A"
+                       return ""
                        
                if self.type == self.NAME:
                        return event.getEventName()
@@ -30,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)