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