Support duo4k.
[vuplus_dvbapp] / timer.py
index 35578ed..d58a83e 100644 (file)
--- a/timer.py
+++ b/timer.py
@@ -232,6 +232,10 @@ class Timer:
                self.setNextActivation(min)
        
        def timeChanged(self, timer):
+               if timer not in (self.processed_timers + self.timer_list):
+                       print "timer not found"
+                       return
+
                print "time changed"
                timer.timeChanged()
                if timer.state == TimerEntry.StateEnded:
@@ -245,6 +249,8 @@ class Timer:
                self.addTimerEntry(timer)
        
        def doActivate(self, w):
+               self.timer_list.remove(w)
+
                # when activating a timer which has already passed,
                # simply abort the timer. don't run trough all the stages.
                if w.shouldSkip():
@@ -256,8 +262,6 @@ class Timer:
                        if w.activate():
                                w.state += 1
 
-               self.timer_list.remove(w)
-
                # did this timer reached the last state?
                if w.state < TimerEntry.StateEnded:
                        # no, sort it into active list