projects
/
saartuer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ralfj.de:saartuer
[saartuer.git]
/
waker.py
diff --git
a/waker.py
b/waker.py
index dc4627b3565d05882d8d1f4d6cb8a687aef01e08..4898c25ab31c0754f79699c97a0983477a8c23af 100644
(file)
--- a/
waker.py
+++ b/
waker.py
@@
-1,10
+1,15
@@
from libtuer import ThreadRepeater
from libtuer import ThreadRepeater
-from collections import namedtuple
from threading import Lock
SLEEP_TIME = 0.5
from threading import Lock
SLEEP_TIME = 0.5
-ToBeWoken = namedtuple('ToBeWoken','f period time_since_call one_shot')
+class ToBeWoken:
+ '''a simple struct storing information about a to-be-woken function'''
+ def __init__(self, f, period, one_shot):
+ self.f = f
+ self.period = period
+ self.time_since_call = 0
+ self.one_shot = one_shot
class Waker():
def __init__(self):
class Waker():
def __init__(self):