[stream-refactor] fix Py2.4 failure by implementing missing Timer method

pull/607/head
David Wilson 5 years ago
parent 54987100b2
commit 65e31f63fe

@ -508,12 +508,18 @@ class Timer(object):
self.when = when self.when = when
self.func = func self.func = func
def __repr__(self):
return 'Timer(%r, %r)' % (self.when, self.func)
def __eq__(self, other): def __eq__(self, other):
return self.when == other.when return self.when == other.when
def __lt__(self, other): def __lt__(self, other):
return self.when < other.when return self.when < other.when
def __le__(self, other):
return self.when <= other.when
def cancel(self): def cancel(self):
""" """
Cancel this event. If it has not yet executed, it will not execute Cancel this event. If it has not yet executed, it will not execute

Loading…
Cancel
Save