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():
|
class Irc():
|
||||||
def __init__(self, netname, proto, conf):
|
def __init__(self, netname, proto, conf):
|
||||||
# threading.Thread.__init__(self)
|
|
||||||
# Initialize some variables
|
# Initialize some variables
|
||||||
self.connected = False
|
self.connected = False
|
||||||
self.name = netname
|
self.name = netname
|
||||||
@ -57,7 +56,6 @@ class Irc():
|
|||||||
self.socket.connect((ip, port))
|
self.socket.connect((ip, port))
|
||||||
self.proto.connect(self)
|
self.proto.connect(self)
|
||||||
self.loaded = []
|
self.loaded = []
|
||||||
self.load_plugins()
|
|
||||||
reading_thread = threading.Thread(target = self.run)
|
reading_thread = threading.Thread(target = self.run)
|
||||||
self.connected = True
|
self.connected = True
|
||||||
reading_thread.start()
|
reading_thread.start()
|
||||||
@ -127,4 +125,5 @@ if __name__ == '__main__':
|
|||||||
log.critical('Failed to load protocol module: import error %s', protoname, str(e))
|
log.critical('Failed to load protocol module: import error %s', protoname, str(e))
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
else:
|
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