Lines Matching refs:self
25 def __init__(self, interval, callback):
43 self._timer = None
44 self._callback = callback
45 self._interval = interval
47 def _is_running(self):
53 return self._timer is not None
55 def start(self):
59 self, the Timer instance
64 if self._is_running():
67 self._timer = threading.Timer(self._interval, self._callback)
68 self._timer.start()
69 return self # so that we can perform Timer(...).start()
71 def stop(self):
75 self, the Timer instance
78 if self._is_running():
79 self._timer.cancel()
80 self._timer = None
81 return self
83 def reset(self):
87 self, the Timer instance
90 self.stop()
91 self.start()
92 return self