mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Forgot to return the name in addEvent.
This commit is contained in:
parent
87f3c2a644
commit
1f441c54bd
@ -79,6 +79,7 @@ class Schedule(drivers.IrcDriver):
|
|||||||
assert name not in self.events
|
assert name not in self.events
|
||||||
self.events[name] = f
|
self.events[name] = f
|
||||||
heapq.heappush(self.schedule, mytuple((t, name)))
|
heapq.heappush(self.schedule, mytuple((t, name)))
|
||||||
|
return name
|
||||||
|
|
||||||
def removeEvent(self, name):
|
def removeEvent(self, name):
|
||||||
"""Removes the event with the given name from the schedule."""
|
"""Removes the event with the given name from the schedule."""
|
||||||
@ -90,8 +91,8 @@ class Schedule(drivers.IrcDriver):
|
|||||||
"""Adds a periodic event that is called every t seconds."""
|
"""Adds a periodic event that is called every t seconds."""
|
||||||
def wrapper():
|
def wrapper():
|
||||||
f()
|
f()
|
||||||
self.addEvent(wrapper, time.time() + t, name)
|
return self.addEvent(wrapper, time.time() + t, name)
|
||||||
wrapper()
|
return wrapper()
|
||||||
|
|
||||||
removePeriodicEvent = removeEvent
|
removePeriodicEvent = removeEvent
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user