Add experimental server password support.

This commit is contained in:
Steve Dougherty 2012-07-03 20:14:14 -04:00
parent 09d8f44fe6
commit a0cbff26af
2 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,8 @@ heartbeat=90
host=irc.freenode.net
mode=NickServ
nickServPassword=applesAndOranges
#Server password: can leave unspecified if there isn't one.
password=ItsASecretToEveryone
[Umich]
host=irc.umich.edu

View File

@ -25,10 +25,13 @@ def main():
for section in config.sections():
def get(option):
return config.get(section, option) or defaults[option]
if option in defaults or config.has_option(section, option):
return config.get(section, option) or defaults[option]
else:
return None
options = {}
for option in [ "timeout", "host", "port", "nick", "channel", "info", "heartbeat" ]:
for option in [ "timeout", "host", "port", "nick", "channel", "info", "heartbeat", "password" ]:
options[option] = get(option)
mode = get("mode")
@ -81,6 +84,7 @@ class IRCRelayer(irc.IRCClient):
def __init__(self, config):
self.network = config['host']
self.password = config['password']
self.channel = config['channel']
self.nickname = config['nick']
self.identifier = config['identifier']