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

This commit is contained in:
David Wilson 2019-07-25 13:19:30 +01:00
parent 54987100b2
commit 65e31f63fe
1 changed files with 6 additions and 0 deletions

View File

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