From 98866dade600f540b2d252446e549704c0c29993 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Wed, 24 Jul 2013 17:08:04 +0300 Subject: Perform a little clean-up --- plugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugin.py') diff --git a/plugin.py b/plugin.py index f8081ba..b3d0bda 100644 --- a/plugin.py +++ b/plugin.py @@ -32,6 +32,7 @@ import threading import BaseHTTPServer import supybot.utils as utils +import supybot.world as world from supybot.commands import * import supybot.plugins as plugins import supybot.ircmsgs as ircmsgs @@ -56,8 +57,9 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): s.wfile.write('') s.wfile.write(vars(s)) # print json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')) - msg = ircmsgs.privmsg("#main", "Someone committed something, check it out") - s.server.irc.queueMsg(msg) + for irc in world.ircs: + msg = ircmsgs.privmsg("#main", "Someone committed something, check it out") + irc.queueMsg(msg) class Github(callbacks.Plugin): @@ -81,8 +83,7 @@ class Github(callbacks.Plugin): self.rng.seed() # automatically seeds with current time server_class = BaseHTTPServer.HTTPServer self.httpd = server_class(('', 8093), GithubHandler) - self.httpd.irc = irc - t = threading.Thread(target=self.ServerStart, args=(self.httpd, irc)) + t = threading.Thread(target=self.ServerStart, args=(self.httpd)) t.daemon = False t.start() @@ -108,3 +109,4 @@ class Github(callbacks.Plugin): Class = Github +# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: -- cgit v1.2.3