Quellcode durchsuchen

Send a message when an IRC-initiated task completes.

tags/v0.3
Ben Kurtovic vor 9 Jahren
Ursprung
Commit
f8bb72f9f2
2 geänderte Dateien mit 5 neuen und 0 gelöschten Zeilen
  1. +3
    -0
      earwigbot/commands/threads.py
  2. +2
    -0
      earwigbot/managers.py

+ 3
- 0
earwigbot/commands/threads.py Datei anzeigen

@@ -142,6 +142,9 @@ class Threads(Command):
return

data.kwargs["fromIRC"] = True
data.kwargs["_IRCCallback"] = lambda: self.reply(
data, "Task \x0302{0}\x0F finished.".format(task_name))

self.bot.tasks.start(task_name, **data.kwargs)
msg = "Task \x0302{0}\x0F started.".format(task_name)
self.reply(data, msg)

+ 2
- 0
earwigbot/managers.py Datei anzeigen

@@ -247,6 +247,8 @@ class TaskManager(_ResourceManager):
else:
msg = "Task '{0}' finished successfully"
self.logger.info(msg.format(task.name))
if kwargs.get("fromIRC"):
kwargs.get("_IRCCallback")()

def start(self, task_name, **kwargs):
"""Start a given task in a new daemon thread, and return the thread.


Laden…
Abbrechen
Speichern