From: Felix Domke Date: Thu, 12 Apr 2007 20:00:33 +0000 (+0000) Subject: properly handle negative time values X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=9829ed5d56e162f9aa8d76b5644c273350f548b8 properly handle negative time values --- diff --git a/lib/python/Components/Converter/ServicePosition.py b/lib/python/Components/Converter/ServicePosition.py index c285385..94d7122 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)