From: Felix Domke Date: Thu, 12 Apr 2007 20:00:33 +0000 (+0000) Subject: properly handle negative time values X-Git-Tag: 2.6.0~2297 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/9829ed5d56e162f9aa8d76b5644c273350f548b8 properly handle negative time values --- diff --git a/lib/python/Components/Converter/ServicePosition.py b/lib/python/Components/Converter/ServicePosition.py index c285385a..94d71222 100644 --- a/lib/python/Components/Converter/ServicePosition.py +++ b/lib/python/Components/Converter/ServicePosition.py @@ -68,7 +68,14 @@ class ServicePosition(Converter, Poll, object): l = self.length - self.position l /= 90000 - return "%d:%02d" % (l/60, l%60) + + if l > 0: + sign = "" + else: + l = -l + sign = "-" + + return sign + "%d:%02d" % (l/60, l%60) position = property(getPosition) length = property(getLength)