- print time.strftime("%c", time.localtime(now))
- print time.strftime("%c", time.localtime(self.begin))
- print time.strftime("%c", time.localtime(self.end))
- print str(time.localtime(self.begin).tm_wday)
- while ((day[time.localtime(self.begin).tm_wday] != 0) or ((day[time.localtime(self.begin).tm_wday] == 0) and self.end < now)):
- print time.strftime("%c", time.localtime(self.begin))
- print time.strftime("%c", time.localtime(self.end))
- self.begin += 86400
- self.end += 86400
-
- def getTime(self):
- if self.state == self.StateWait:
- return self.begin - self.prepare_time
- elif self.state == self.StatePrepare:
- return self.begin
- else:
- return self.end
-
+ print strftime("%c", localnow)
+ while ((day[localbegin.tm_wday] != 0) or ((day[localbegin.tm_wday] == 0) and localend < localnow)):
+ print strftime("%c", localbegin)
+ print strftime("%c", localend)
+ #add one day to the struct_time, we have to convert using gmt functions, because the daylight saving flag might change after we add our 86400 seconds
+ localbegin = gmtime(timegm(localbegin) + 86400)
+ localend = gmtime(timegm(localend) + 86400)
+
+ #we now have a struct_time representation of begin and end in localtime, but we have to calculate back to (gmt) seconds since epoch
+ self.begin = int(mktime(localbegin))
+ self.end = int(mktime(localend)) + 1
+
+ print "ProcessRepeated result"
+ print strftime("%c", localtime(self.begin))
+ print strftime("%c", localtime(self.end))
+
+ self.timeChanged()
+