X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6c8ddb8573c023e50222cbda8e72287106bac528..fc102394e60824f5c07da710d36ba28eaf160c72:/lib/python/Components/Converter/ServicePosition.py diff --git a/lib/python/Components/Converter/ServicePosition.py b/lib/python/Components/Converter/ServicePosition.py index b488258b..d7a55dae 100644 --- a/lib/python/Components/Converter/ServicePosition.py +++ b/lib/python/Components/Converter/ServicePosition.py @@ -19,6 +19,7 @@ class ServicePosition(Converter, Poll, object): self.negate = 'Negate' in args self.detailed = 'Detailed' in args self.showHours = 'ShowHours' in args + self.showNoSeconds = 'ShowNoSeconds' in args if self.detailed: self.poll_interval = 100 @@ -34,7 +35,7 @@ class ServicePosition(Converter, Poll, object): elif type == "Gauge": self.type = self.TYPE_GAUGE else: - raise "type must be {Length|Position|Remaining|Gauge} with optional arguments {Negate|Detailed|ShowHours}" + raise "type must be {Length|Position|Remaining|Gauge} with optional arguments {Negate|Detailed|ShowHours|NoSeconds}" self.poll_enabled = self.type != self.TYPE_LENGTH @@ -94,9 +95,15 @@ class ServicePosition(Converter, Poll, object): if not self.detailed: if self.showHours: - return sign + "%d:%02d:%02d" % (l/3600, l%3600/60, l%60) + if self.showNoSeconds: + return sign + "%d:%02d" % (l/3600, l%3600/60) + else: + return sign + "%d:%02d:%02d" % (l/3600, l%3600/60, l%60) else: - return sign + "%d:%02d" % (l/60, l%60) + if self.showNoSeconds: + return sign + "%d" % (l/60) + else: + return sign + "%d:%02d" % (l/60, l%60) else: if self.showHours: return sign + "%d:%02d:%02d:%03d" % ((l/3600/90000), (l/90000)%3600/60, (l/90000)%60, (l%90000)/90)