diff options
Diffstat (limited to 'lib/python/Components/Converter/RemainingToText.py')
| -rw-r--r-- | lib/python/Components/Converter/RemainingToText.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/RemainingToText.py b/lib/python/Components/Converter/RemainingToText.py new file mode 100644 index 00000000..534fef18 --- /dev/null +++ b/lib/python/Components/Converter/RemainingToText.py @@ -0,0 +1,19 @@ +from Components.Converter.Converter import Converter + +class RemainingToText(Converter, object): + def __init__(self, type, *args, **kwargs): + Converter.__init__(self) + + 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) |
