3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

validateConf: allow autojoin channels to be empty; nothing wrong with that

This commit is contained in:
James Lu 2015-09-28 19:22:19 -07:00
parent 54414f307e
commit 48831863d2

View File

@ -39,9 +39,9 @@ def validateConf(conf):
assert conf.get(section), "Missing %r section in config." % section assert conf.get(section), "Missing %r section in config." % section
for netname, serverblock in conf['servers'].items(): for netname, serverblock in conf['servers'].items():
for section in ('ip', 'port', 'recvpass', 'sendpass', 'hostname', for section in ('ip', 'port', 'recvpass', 'sendpass', 'hostname',
'sid', 'sidrange', 'channels', 'protocol', 'maxnicklen'): 'sid', 'sidrange', 'protocol', 'maxnicklen'):
assert serverblock.get(section), "Missing %r in server block for %r." % (section, netname) assert serverblock.get(section), "Missing %r in server block for %r." % (section, netname)
assert type(serverblock['channels']) == list, "'channels' option in " \ assert type(serverblock.get('channels')) == list, "'channels' option in " \
"server block for %s must be a list, not %s." % (netname, type(serverblock['channels']).__name__) "server block for %s must be a list, not %s." % (netname, type(serverblock['channels']).__name__)
assert type(conf['login'].get('password')) == type(conf['login'].get('user')) == str and \ assert type(conf['login'].get('password')) == type(conf['login'].get('user')) == str and \
conf['login']['password'] != "changeme", "You have not set the login details correctly!" conf['login']['password'] != "changeme", "You have not set the login details correctly!"