Support turbo2.
[vuplus_dvbapp] / lib / python / Screens / TimerEdit.py
index 6e8859e..0abb42a 100644 (file)
@@ -13,7 +13,7 @@ from ServiceReference import ServiceReference
 from TimerEntry import TimerEntry, TimerLog
 from Tools.BoundFunction import boundFunction
 from time import time
 from TimerEntry import TimerEntry, TimerLog
 from Tools.BoundFunction import boundFunction
 from time import time
-from timer import TimerEntry
+from timer import TimerEntry as RealTimerEntry
 
 class TimerEditList(Screen):
        EMPTY = 0
 
 class TimerEditList(Screen):
        EMPTY = 0
@@ -89,7 +89,9 @@ class TimerEditList(Screen):
                                if not timersanitycheck.check():
                                        t.disable()
                                        print "Sanity check failed"
                                if not timersanitycheck.check():
                                        t.disable()
                                        print "Sanity check failed"
-                                       self.session.openWithCallback(self.finishedEdit, TimerSanityConflict, timersanitycheck.getSimulTimerList())
+                                       simulTimerList = timersanitycheck.getSimulTimerList()
+                                       if simulTimerList is not None:
+                                               self.session.openWithCallback(self.finishedEdit, TimerSanityConflict, simulTimerList)
                                else:
                                        print "Sanity check passed"
                                        if timersanitycheck.doubleCheck():
                                else:
                                        print "Sanity check passed"
                                        if timersanitycheck.doubleCheck():
@@ -175,9 +177,9 @@ class TimerEditList(Screen):
        def fillTimerList(self):
                #helper function to move finished timers to end of list
                def eol_compare(x, y):
        def fillTimerList(self):
                #helper function to move finished timers to end of list
                def eol_compare(x, y):
-                       if x[0].state != y[0].state and x[0].state == TimerEntry.StateEnded or y[0].state == TimerEntry.StateEnded:
+                       if x[0].state != y[0].state and x[0].state == RealTimerEntry.StateEnded or y[0].state == RealTimerEntry.StateEnded:
                                return cmp(x[0].state, y[0].state)
                                return cmp(x[0].state, y[0].state)
-                       return cmp(x[0].begin, x[1].begin)
+                       return cmp(x[0].begin, y[0].begin)
 
                list = self.list
                del list[:]
 
                list = self.list
                del list[:]