X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=timer.py;h=750a8c0300e2537c90628fd4c1e23f07a3deeeff;hp=056963513bd9a2699d9802d3715cda892ab10406;hb=5c68c7007814f2da8776ac23b66a04abdabaa1fb;hpb=6f73e6abddf4170357c490966d0e1c622eb376f5 diff --git a/timer.py b/timer.py index 0569635..750a8c0 100644 --- a/timer.py +++ b/timer.py @@ -3,6 +3,8 @@ from time import strftime, time, localtime, mktime from enigma import eTimer import datetime +import NavigationInstance + class TimerEntry: StateWaiting = 0 StatePrepared = 1 @@ -21,7 +23,13 @@ class TimerEntry: self.backoff = 0 self.disabled = False - + + def resetState(self): + self.state = self.StateWaiting + self.cancelled = False + self.first_try_prepare = True + self.timeChanged() + def resetRepeated(self): self.repeated = int(0) @@ -169,6 +177,27 @@ class Timer: insort(self.timer_list, entry) if not noRecalc: self.calcNextActivation() + +# small piece of example code to understand how to use record simulation +# if NavigationInstance.instance: +# lst = [ ] +# cnt = 0 +# for timer in self.timer_list: +# print "timer", cnt +# cnt += 1 +# if timer.state == 0: #waiting +# lst.append(NavigationInstance.instance.recordService(timer.service_ref)) +# else: +# print "STATE: ", timer.state +# +# for rec in lst: +# if rec.start(True): #simulate +# print "FAILED!!!!!!!!!!!!" +# else: +# print "OK!!!!!!!!!!!!!!" +# NavigationInstance.instance.stopRecordService(rec) +# else: +# print "no NAV" def setNextActivation(self, when): delay = int((when - time()) * 1000)