From: W. Trevor King Date: Fri, 7 Mar 2014 04:21:12 +0000 (-0800) Subject: irkerd: Replace 'password' global with local Connection.password X-Git-Tag: 2.7~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f52ae77db0199703e10101b985ec1ab4af26f288;p=irker.git irkerd: Replace 'password' global with local Connection.password Using the new kwargs handling to pass the data through Irker() down to Connection(). Note that this is the nickserv password, not the server-wide login password used by Connection.connect(). --- diff --git a/irkerd b/irkerd index bb54f85..619cdbb 100755 --- a/irkerd +++ b/irkerd @@ -381,11 +381,12 @@ def is_channel(string): class Connection: def __init__(self, irker, target, nick_template, nick_needs_number=False, - **kwargs): + password=None, **kwargs): self.irker = irker self.target = target self.nick_template = nick_template self.nick_needs_number = nick_needs_number + self.password = password self.kwargs = kwargs self.nick_trial = None self.connection = None @@ -412,8 +413,8 @@ class Connection: "The server says we're OK, with a non-conflicting nick." self.status = "ready" LOG.info("nick %s accepted" % self.nickname()) - if password: - self.connection.privmsg("nickserv", "identify %s" % password) + if self.password: + self.connection.privmsg("nickserv", "identify %s" % self.password) def handle_badnick(self): "The server says our nick is ill-formed or has a conflict." LOG.info("nick %s rejected" % self.nickname()) @@ -933,6 +934,7 @@ if __name__ == '__main__': logfile=logfile, nick_template=nick_template, nick_needs_number=re.search("%.*d", nick_template), + password=password, ) LOG.info("irkerd version %s" % version) if immediate: