small optimizations and cleanups by Moritz Venn
[vuplus_dvbapp] / lib / python / Components / Converter / ServicePosition.py
index d7a55da..b92af40 100644 (file)
@@ -1,7 +1,7 @@
 from Converter import Converter
 from Poll import Poll
 from enigma import iPlayableService
-from Components.Element import cached
+from Components.Element import cached, ElementError
 
 class ServicePosition(Converter, Poll, object):
        TYPE_LENGTH = 0
@@ -35,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|NoSeconds}"
+                       raise ElementError("type must be {Length|Position|Remaining|Gauge} with optional arguments {Negate|Detailed|ShowHours|ShowNoSeconds} for ServicePosition converter")
 
                self.poll_enabled = self.type != self.TYPE_LENGTH
 
@@ -128,8 +128,8 @@ class ServicePosition(Converter, Poll, object):
        value = property(getValue)
 
        def changed(self, what):
-               cutlist_refresh = what[0] != self.CHANGED_SPECIFIC or what[1] in [iPlayableService.evCuesheetChanged]
-               time_refresh = what[0] == self.CHANGED_POLL or what[0] == self.CHANGED_SPECIFIC and what[1] in [iPlayableService.evCuesheetChanged]
+               cutlist_refresh = what[0] != self.CHANGED_SPECIFIC or what[1] in (iPlayableService.evCuesheetChanged,)
+               time_refresh = what[0] == self.CHANGED_POLL or what[0] == self.CHANGED_SPECIFIC and what[1] in (iPlayableService.evCuesheetChanged,)
 
                if cutlist_refresh:
                        if self.type == self.TYPE_GAUGE: