projects
/
saartuer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
faba368
)
Re-implement ToBeWoken as class instead of namedtuple (it must be modifiable)
author
Ralf Jung
<post@ralfj.de>
Sun, 27 Oct 2013 15:51:16 +0000
(16:51 +0100)
committer
Ralf Jung
<post@ralfj.de>
Sun, 27 Oct 2013 15:51:16 +0000
(16:51 +0100)
waker.py
patch
|
blob
|
history
diff --git
a/waker.py
b/waker.py
index 9c2cf06c40dbae3fbd9d8fc5822a74abff6bb0d2..681de1b1af4985fe33e2d80ee6798e2844a43188 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, sm):
class Waker():
def __init__(self, sm):