3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +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.name = netname
self.conf = conf.conf
self.sid = None
self.serverdata = conf.conf['servers'][netname]
if not hasattr(self, 'sid'):
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.proto = self.irc = self # Backwards compat