git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make comment a bit more generic
[enigma2.git]
/
timer.py
diff --git
a/timer.py
b/timer.py
index c8e7854992418f9cdf1eaaa7c395838e9ad53ec7..9fa0ab2a865dd26d9a012af554ed0fedfa760534 100644
(file)
--- a/
timer.py
+++ b/
timer.py
@@
-53,6
+53,9
@@
class TimerEntry:
print time.strftime("%c", time.localtime(self.end))
self.begin += 86400
self.end += 86400
print time.strftime("%c", time.localtime(self.end))
self.begin += 86400
self.end += 86400
+
+ self.timeChanged()
+
def __lt__(self, o):
return self.getNextActivation() < o.getNextActivation()
def __lt__(self, o):
return self.getNextActivation() < o.getNextActivation()
@@
-102,9
+105,11
@@
class Timer:
self.lastActivation = time.time()
self.calcNextActivation()
self.lastActivation = time.time()
self.calcNextActivation()
+ self.on_state_change = [ ]
def stateChanged(self, entry):
def stateChanged(self, entry):
- pass
+ for f in self.on_state_change:
+ f(entry)
def addTimerEntry(self, entry, noRecalc=0):
entry.processRepeated()
def addTimerEntry(self, entry, noRecalc=0):
entry.processRepeated()
@@
-178,7
+183,7
@@
class Timer:
bisect.insort(self.timer_list, w)
else:
# yes. Process repeated, and re-add.
bisect.insort(self.timer_list, w)
else:
# yes. Process repeated, and re-add.
- if
not
w.repeated:
+ if w.repeated:
w.processRepeated()
w.state = TimerEntry.StateWaiting
self.addTimerEntry(w)
w.processRepeated()
w.state = TimerEntry.StateWaiting
self.addTimerEntry(w)