3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-26 20:52:45 +01:00

PyLinkNC: don't overwrite sid, serverdata if they're already set

This commit is contained in:
James Lu 2019-02-20 13:21:08 -08:00
parent 24f85acfb8
commit 4f17a7986b

View File

@ -229,8 +229,11 @@ class PyLinkNetworkCore(structures.CamelCaseToSnakeCase):
self.loghandlers = [] self.loghandlers = []
self.name = netname self.name = netname
self.conf = conf.conf self.conf = conf.conf
self.sid = None if not hasattr(self, 'sid'):
self.serverdata = conf.conf['servers'][netname] self.sid = None
# serverdata may be overridden as a property on some protocols
if netname in conf.conf['servers'] and not hasattr(self, 'serverdata'):
self.serverdata = conf.conf['servers'][netname]
self.protoname = self.__class__.__module__.split('.')[-1] # Remove leading pylinkirc.protocols. self.protoname = self.__class__.__module__.split('.')[-1] # Remove leading pylinkirc.protocols.
self.proto = self.irc = self # Backwards compat self.proto = self.irc = self # Backwards compat