mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-19 23:20:57 +01:00
Fix for scheduler.list showing ran (but not removed) events.
This commit is contained in:
parent
42301c1117
commit
c96065a540
@ -61,6 +61,7 @@ class Scheduler(callbacks.Privmsg):
|
|||||||
if ambiguous:
|
if ambiguous:
|
||||||
raise callbacks.Error, callbacks.ambiguousReply(ambiguous)
|
raise callbacks.Error, callbacks.ambiguousReply(ambiguous)
|
||||||
def f():
|
def f():
|
||||||
|
del self.events[f.eventId]
|
||||||
self.Proxy(irc.irc, msg, tokens)
|
self.Proxy(irc.irc, msg, tokens)
|
||||||
return f
|
return f
|
||||||
|
|
||||||
@ -81,6 +82,7 @@ class Scheduler(callbacks.Privmsg):
|
|||||||
return
|
return
|
||||||
f = self._makeCommandFunction(irc, msg, command)
|
f = self._makeCommandFunction(irc, msg, command)
|
||||||
id = schedule.addEvent(f, time.time() + seconds)
|
id = schedule.addEvent(f, time.time() + seconds)
|
||||||
|
f.eventId = id
|
||||||
self.events[str(id)] = command
|
self.events[str(id)] = command
|
||||||
irc.replySuccess('Event #%s added.' % id)
|
irc.replySuccess('Event #%s added.' % id)
|
||||||
|
|
||||||
@ -131,6 +133,7 @@ class Scheduler(callbacks.Privmsg):
|
|||||||
id = schedule.addPeriodicEvent(f, seconds, name)
|
id = schedule.addPeriodicEvent(f, seconds, name)
|
||||||
assert id == name
|
assert id == name
|
||||||
# We don't reply because the command runs immediately.
|
# We don't reply because the command runs immediately.
|
||||||
|
# But should we? What if the command doesn't have visible output?
|
||||||
# irc.replySuccess()
|
# irc.replySuccess()
|
||||||
|
|
||||||
def list(self, irc, msg, args):
|
def list(self, irc, msg, args):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user