mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-24 03:04: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:
parent
3156d83ec3
commit
11e27b9f36
5
main.py
5
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()
|
||||
|
Loading…
Reference in New Issue
Block a user