3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-23 18:54:05 +01:00

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.
This commit is contained in:
James Lu 2015-07-10 20:24:08 -07:00
parent 3156d83ec3
commit 11e27b9f36

View File

@ -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()