diff --git a/OperUp/README.txt b/OperUp/README.txt index d60b47a..fca2900 100644 --- a/OperUp/README.txt +++ b/OperUp/README.txt @@ -1 +1 @@ -Insert a description of your plugin here, with any notes, etc. about using it. +Simple plugin that allows Supybot to oper up on configured networks, on connect and manually. diff --git a/OperUp/config.py b/OperUp/config.py index d0adebb..74f137b 100644 --- a/OperUp/config.py +++ b/OperUp/config.py @@ -46,16 +46,18 @@ def configure(advanced): from supybot.questions import expect, anything, something, yn conf.registerPlugin('OperUp', True) - OperUp = conf.registerPlugin('OperUp') conf.registerGlobalValue(OperUp, 'operName', - registry.String("", _("""Specifies the name of the Oper block the bot will use."""), private=True)) + registry.String("", _("""Specifies the name of the Oper block the bot will + use."""), private=True)) conf.registerGlobalValue(OperUp, 'operPass', - registry.String("", _("""Specifies the password of the Oper block the bot will use."""), private=True)) + registry.String("", _("""Specifies the password of the Oper block the bot + will use."""), private=True)) conf.registerGlobalValue(OperUp, 'operNets', - registry.SpaceSeparatedListOfStrings("", _("""Space separated list of network names to Oper up on (denoted by 005 name)"""), private=True)) + registry.SpaceSeparatedListOfStrings("", _("""Space separated list of + network names to Oper up on (denoted by 005 name)"""), private=True)) conf.registerGlobalValue(OperUp, 'operModes', - registry.SpaceSeparatedListOfStrings("", _("""Specifies the mode(s) the bot will set on itself when it Opers up."""), private=True)) - + registry.SpaceSeparatedListOfStrings("", _("""Specifies the mode(s) the + bot will set on itself when it Opers up."""), private=True)) # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: \ No newline at end of file diff --git a/OperUp/plugin.py b/OperUp/plugin.py index e698fc0..13e725f 100644 --- a/OperUp/plugin.py +++ b/OperUp/plugin.py @@ -43,48 +43,67 @@ except: _ = lambda x:x class OperUp(callbacks.Plugin): - """Add the help for "@plugin help OperUp" here - This should describe *how* to use this plugin.""" + """Simple plugin that allows Supybot to oper up on configured networks, on + connect and manually.""" def do005(self, irc, msg): """Oper up on connect.""" if irc.network in self.registryValue('operNets'): - if self.registryValue("operName") and self.registryValue("operPass"): - irc.sendMsg(ircmsgs.IrcMsg(command="OPER", args=[self.registryValue("operName"), self.registryValue("operPass")])) + if self.registryValue("operName") and \ + self.registryValue("operPass"): + irc.sendMsg(ircmsgs.IrcMsg(command="OPER", + args=[self.registryValue("operName"), + self.registryValue("operPass")])) else: - self.log.error("OperUp: Bot is set to oper on network %s, but operName and/or operPass are not defined!") + self.log.error("OperUp: Bot is set to oper on network %s, but" + " operName and/or operPass are not defined!") def do381(self, irc, msg): - self.log.info("OperUp: Received 381 (successfully opered up) from network %s." % irc.network) + self.log.info("OperUp: Received 381 (successfully opered up) from " + "network %s." % irc.network) if self.registryValue("operModes"): - self.log.info("OperUp: Opered up on %s, sending user modes %s" % (irc.network, ''.join(self.registryValue("operModes")))) - irc.sendMsg(ircmsgs.mode(irc.nick, self.registryValue("operModes"))) + self.log.info("OperUp: Opered up on %s, sending user modes %s" + % (irc.network, ''.join(self.registryValue("operModes")))) + irc.sendMsg(ircmsgs.mode(irc.nick, + self.registryValue("operModes"))) def do385(self, irc, msg): - self.log.info("OperUp: Received 385 (not opered anymore) from network %s." % irc.network) + self.log.info("OperUp: Received 385 (not opered anymore) from network" + " %s." % irc.network) def do461(self, irc, msg): - self.log.warning("OperUp: Received 461 (some command needs more parameters) from network %s." % irc.network) + self.log.warning("OperUp: Received 461 (some command needs more " + "parameters) from network %s." % irc.network) def do464(self, irc, msg): - self.log.error("OperUp: Received 461 (password mismatch) from network %s." % irc.network) + self.log.error("OperUp: Received 461 (password mismatch) from " + "network %s." % irc.network) def do481(self, irc, msg): - self.log.warning("OperUp: Received 481 (missing oper privileges) from network %s." % irc.network) + self.log.warning("OperUp: Received 481 (missing oper privileges) " + "from network %s." % irc.network) def do491(self, irc, msg): - self.log.error("OperUp: Received 491 (server has been configured to disallow the your bot's host from opering) from network %s." % irc.network) + self.log.error("OperUp: Received 491 (server has been configured " + "to disallow the your bot's host from opering) from network %s." \ + % irc.network) def operup(self, irc, msg, args): """Oper up.""" if irc.network in self.registryValue('operNets'): - if self.registryValue("operName") and self.registryValue("operPass"): - irc.sendMsg(ircmsgs.IrcMsg(command="OPER", args=[self.registryValue("operName"), self.registryValue("operPass")])) + if self.registryValue("operName") and \ + self.registryValue("operPass"): + irc.sendMsg(ircmsgs.IrcMsg(command="OPER", + args=[self.registryValue("operName"), + self.registryValue("operPass")])) irc.replySuccess() else: - irc.error(_('Either the operName or the operPass configuration values were not properly defined. Please check to see these values are correct!')) + irc.error(_("Either the operName or the operPass " + "configuration values were not properly defined. Please " + "check to see these values are correct!")) else: - irc.error(_('This network is not configured for opering up! (see @config plugins.OperUp.opernets)')) + irc.error(_("This network is not configured for opering up! (see" + " @config plugins.OperUp.opernets)")) operup = wrap(operup, ['owner']) def deoper(self, irc, msg, args):