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