From d13a5069e3a0e78a77bf16effe78f2ba223c495b Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 27 Nov 2018 14:25:12 +0000 Subject: Grab response from functions asked to be executed on the main thread and feed them back to the callers, allowing rest_api.py to take the main thread while it's waiting for the response to give back to the requesting client --- modules/github.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'modules/github.py') diff --git a/modules/github.py b/modules/github.py index ecfe8e7a..dbe20b70 100644 --- a/modules/github.py +++ b/modules/github.py @@ -86,16 +86,13 @@ class Module(ModuleManager.BaseModule): for server, channel in targets: for output in outputs: output = "(%s) %s" % (full_name, output) - trigger = self._make_trigger(channel, server, output) - self.bot.trigger(trigger) + self.events.on("send.stdout").call(target=channel, + module_name="Github", server=server, message=line, + hide_prefix=channel.get_setting( + "github-hide-prefix", False)) return True - def _make_trigger(self, channel, server, line): - return lambda: self.events.on("send.stdout").call(target=channel, - module_name="Github", server=server, message=line, - hide_prefix=channel.get_setting("github-hide-prefix", False)) - def _change_count(self, n, symbol, color): return utils.irc.color("%s%d" % (symbol, n), color)+utils.irc.bold("") def _added(self, n): -- cgit v1.3.1-10-gc9f91