fix caching
[enigma2.git] / lib / python / Components / Converter / RemainingToText.py
1 from Components.Converter.Converter import Converter
2 from Components.Element import cached
3
4 class RemainingToText(Converter, object):
5         def __init__(self, type):
6                 Converter.__init__(self, type)
7
8         @cached
9         def getText(self):
10                 r = self.source.time
11                 if r is None:
12                         return ""
13
14                 (duration, remaining) = self.source.time
15                 if remaining is not None:
16                         return "+%d min" % (remaining / 60)
17                 else:
18                         return "%d min" % (duration / 60)
19
20         text = property(getText)