add new skin stuff
[enigma2.git] / lib / python / Components / Converter / EventName.py
1 from Components.Converter.Converter import Converter
2
3 class EventName(Converter, object):
4         NAME = 0
5         SHORT_DESCRIPTION = 1
6         EXTENDED_DESCRIPTION = 2
7
8         def __init__(self, type, *args, **kwargs):
9                 Converter.__init__(self)
10                 if type == "Description":
11                         self.type = self.SHORT_DESCRIPTION
12                 elif type == "ExtendedDescription":
13                         self.type = self.EXTENDED_DESCRIPTION
14                 else:
15                         self.type = self.NAME
16
17         def getText(self):
18                 event = self.source.event
19                 if event is None:
20                         return ""
21                         
22                 if self.type == self.NAME:
23                         return event.getEventName()
24                 elif self.type == self.SHORT_DESCRIPTION:
25                         return event.getShortDescription()
26                 elif self.type == self.EXTENDED_DESCRIPTION:
27                         return event.getExtendedDescription()
28                         
29         text = property(getText)