fixed repeated timers
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Thu, 17 Nov 2005 04:57:49 +0000 (04:57 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Thu, 17 Nov 2005 04:57:49 +0000 (04:57 +0000)
lib/python/Components/TimerList.py
lib/python/Screens/TimerEdit.py
timer.py

index 81501ca8388330a1eb5d2b04318a51aeb2dff0b0..6511f6f125768c2c0cca1c4f524e4453a3ac910d 100644 (file)
@@ -2,6 +2,7 @@ from HTMLComponent import *
 from GUIComponent import *
 
 from Tools.FuzzyDate import FuzzyTime
+import time
 
 from enigma import eListboxPythonMultiContent, eListbox, gFont
 from timer import TimerEntry
@@ -25,7 +26,6 @@ RT_WRAP = 32
 def TimerEntryComponent(timer, processed):
        res = [ timer ]
        
-
        res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, timer.service_ref.getServiceName()))
        repeatedtext = ""
        days = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ]
@@ -39,8 +39,6 @@ def TimerEntryComponent(timer, processed):
                                        repeatedtext += days[x]
                                        count += 1
                                flags = flags >> 1
-               print [FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1]]
-               print (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:])
                res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, repeatedtext + (" %s ... %s" % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1]))))
        else:
                res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, repeatedtext + ("%s, %s ... %s" % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:]))))
index 4f5039ec9bacaa74d3a8cf82017739ed6f81a208..0f902679e1d49a061282cd5d116b0946e3e6b143 100644 (file)
@@ -89,6 +89,7 @@ class TimerEditList(Screen):
        def finishedEdit(self, answer):
                if (answer[0]):
                        print "Edited timer"
+                       self.session.nav.RecordTimer.timeChanged(answer[1])
                        self.fillTimerList()
                else:
                        print "Timeredit aborted"
index 525014fe719460591bf6ab7a2b5eadab6992692c..afbbfdf8a03117013d40a39b9860c98eaae6b0ab 100644 (file)
--- a/timer.py
+++ b/timer.py
@@ -29,19 +29,26 @@ class TimerEntry:
                
        # update self.begin and self.end according to the self.repeated-flags
        def processRepeated(self):
+               print "Processing repeated"
                if (self.repeated != 0):
-                       now = time.time()
+                       now = int(time.time())
+                       print "Now: " + str(now)
                        
                        day = []
                        flags = self.repeated
                        for x in range(0, 7):
                                if (flags & 1 == 1):
                                        day.append(0)
+                                       print "Day " + str(x)
                                else:
                                        day.append(1)
                                flags = flags >> 1
 
-                       while ((day[time.localtime(self.begin).tm_wday] != 0) and (self.end > now)):
+                       print time.localtime(self.begin).tm_wday
+                       print day
+                       print str(now) + " " + str(self.end) + " " + str(self.begin)
+                       while ((day[time.localtime(self.begin).tm_wday] != 0) and (self.end < now)):
+                               print str(now) + " " + str(self.end) + " " + str(self.begin)
                                self.begin += 86400
                                self.end += 86400