Commit c557bfbd authored by Ralf's avatar Ralf
Browse files

Re-implement ToBeWoken as class instead of namedtuple (it must be modifiable)

parent faba368e
from libtuer import ThreadRepeater
from collections import namedtuple
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):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment