From 11e27b9f36283b2c20293c94564463e2ede2ac27 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 10 Jul 2015 20:24:08 -0700 Subject: [PATCH] main.Irc: only load plugins after the IRC object is initialized in utils.networkobjects PyLink-Relay (#37) needs this in order to fetch the IRC objects of various networks at start. --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 526d9b2..6f2a7b8 100755 --- a/main.py +++ b/main.py @@ -15,7 +15,6 @@ import utils class Irc(): def __init__(self, netname, proto, conf): - # threading.Thread.__init__(self) # Initialize some variables self.connected = False self.name = netname @@ -57,7 +56,6 @@ class Irc(): self.socket.connect((ip, port)) self.proto.connect(self) self.loaded = [] - self.load_plugins() reading_thread = threading.Thread(target = self.run) self.connected = True reading_thread.start() @@ -127,4 +125,5 @@ if __name__ == '__main__': log.critical('Failed to load protocol module: import error %s', protoname, str(e)) sys.exit(2) else: - utils.networkobjects[network] = Irc(network, proto, conf.conf) + utils.networkobjects[network] = irc = Irc(network, proto, conf.conf) + irc.load_plugins()