projects
/
vuplus_dvbapp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1102743
)
timer: passed timers will always be set to StateEnded, and set back to waiting when...
author
Felix Domke
<tmbinc@elitedvb.net>
Mon, 28 Nov 2005 03:57:37 +0000
(
03:57
+0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Mon, 28 Nov 2005 03:57:37 +0000
(
03:57
+0000)
RecordTimer.py
patch
|
blob
|
history
timer.py
patch
|
blob
|
history
diff --git
a/RecordTimer.py
b/RecordTimer.py
index
18cc64a
..
1a64c5e
100644
(file)
--- a/
RecordTimer.py
+++ b/
RecordTimer.py
@@
-162,14
+162,13
@@
class RecordTimer(timer.Timer):
self.timeChanged(entry)
elif entry.state != timer.TimerEntry.StateEnded:
entry.activate(timer.TimerEntry.EventAbort)
self.timeChanged(entry)
elif entry.state != timer.TimerEntry.StateEnded:
entry.activate(timer.TimerEntry.EventAbort)
- try: # FIXME: is needed, because after loading the timers, every timer (even already ended ones)
- # have the state EventWaiting..
- self.timer_list.remove(entry)
- except:
- pass
-
+ self.timer_list.remove(entry)
+
self.calcNextActivation()
print "timer did not yet start - removing"
self.calcNextActivation()
print "timer did not yet start - removing"
+
+ # the timer was aborted, and removed.
+ return
else:
print "timer did already end - doing nothing."
else:
print "timer did already end - doing nothing."
@@
-177,10
+176,7
@@
class RecordTimer(timer.Timer):
print "in processed: ", entry in self.processed_timers
print "in running: ", entry in self.timer_list
# now the timer should be in the processed_timers list. remove it from there.
print "in processed: ", entry in self.processed_timers
print "in running: ", entry in self.timer_list
# now the timer should be in the processed_timers list. remove it from there.
- try:
- self.processed_timers.remove(entry)
- except:
- pass
+ self.processed_timers.remove(entry)
def shutdown(self):
self.saveTimer()
def shutdown(self):
self.saveTimer()
diff --git
a/timer.py
b/timer.py
index
bbad0be
..
f5aee84
100644
(file)
--- a/
timer.py
+++ b/
timer.py
@@
-103,6
+103,7
@@
class Timer:
# right into the processedTimers.
if entry.end <= time.time() and entry.state == TimerEntry.StateWait:
bisect.insort(self.processed_timers, entry)
# right into the processedTimers.
if entry.end <= time.time() and entry.state == TimerEntry.StateWait:
bisect.insort(self.processed_timers, entry)
+ entry.state = TimerEntry.StateEnded
else:
bisect.insort(self.timer_list, entry)
if not noRecalc:
else:
bisect.insort(self.timer_list, entry)
if not noRecalc:
@@
-121,6
+122,8
@@
class Timer:
tl = self.processed_timers
self.processed_timers = [ ]
for x in tl:
tl = self.processed_timers
self.processed_timers = [ ]
for x in tl:
+ # simulate a "waiting" state to give them a chance to re-occure
+ x.state = TimerEntry.StateWaiting
self.addTimerEntry(x, noRecalc=1)
self.processActivation()
self.addTimerEntry(x, noRecalc=1)
self.processActivation()