From efb7891f467587a0bc1a884fbaa20c6eeca0e233 Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 11 Aug 2004 12:57:52 +0000 Subject: [PATCH] pylint cleanups --- src/Channel.py | 6 +++--- src/Owner.py | 9 +++++---- src/callbacks.py | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Channel.py b/src/Channel.py index 9622e366b..30adf0da4 100755 --- a/src/Channel.py +++ b/src/Channel.py @@ -96,7 +96,7 @@ class Channel(callbacks.Privmsg): channel limit. is only necessary if the message isn't sent in the channel itself. """ - limit = privmsg.getArgs(args) + limit = privmsgs.getArgs(args) try: limit = int(limit) if limit < 0: @@ -122,7 +122,7 @@ class Channel(callbacks.Privmsg): if self.haveOps(irc, channel, 'moderate the channel'): irc.queueMsg(ircmsgs.mode(channel, ['+m'])) moderate = privmsgs.checkChannelCapability(moderate, 'op') - + def unmoderate(self, irc, msg, args, channel): """[] @@ -149,7 +149,7 @@ class Channel(callbacks.Privmsg): if self.haveOps(irc, channel, 'unset the keyword'): irc.queueMsg(ircmsgs.mode(channel, ['-k'])) key = privmsgs.checkChannelCapability(key, 'op') - + def op(self, irc, msg, args, channel): """[] [ ...] diff --git a/src/Owner.py b/src/Owner.py index 3789fb974..d01be8b99 100644 --- a/src/Owner.py +++ b/src/Owner.py @@ -126,7 +126,7 @@ conf.supybot.plugins.Owner.register('public', registry.Boolean(True, ### # supybot.commands. ### - + conf.registerGroup(conf.supybot.commands, 'defaultPlugins') conf.supybot.commands.defaultPlugins.help = utils.normalizeWhitespace(""" Determines what commands have default plugins set, and which plugins are set to @@ -241,8 +241,9 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg): self.log.error('Error loading src/ plugin %s. ' 'This is usually rather ' 'serious; these plugins are ' - 'almost always be loaded.', s) - + 'almost always be loaded.', + name) + except Exception, e: log.exception('Failed to load %s:', name) else: @@ -650,7 +651,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg): setattr(cb.__class__, name, method) delattr(cb.__class__, command) irc.replySuccess() - + diff --git a/src/callbacks.py b/src/callbacks.py index 86306318c..fb9ad503a 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -426,7 +426,7 @@ class RichReplyMethods(object): else: log.warning('Denying %s for some unspecified capability ' '(or a default)', self.msg.prefix) - v = conf.supybot.replies.genericNoCapability.get(msg.args[0])() + v = conf.supybot.replies.genericNoCapability.get(self.msg.args[0])() self.error(self.__makeReply(v, s), **kwargs) def errorPossibleBug(self, s='', **kwargs): @@ -751,7 +751,7 @@ class CanonicalString(registry.NormalizedString): class CanonicalNameSet(utils.NormalizingSet): def normalize(self, s): return canonicalName(s) - + class CanonicalNameDict(utils.InsensitivePreservingDict): def key(self, s): return canonicalName(s) @@ -759,12 +759,12 @@ class CanonicalNameDict(utils.InsensitivePreservingDict): class Disabled(registry.SpaceSeparatedListOf): Value = CanonicalString List = CanonicalNameSet - + conf.registerGlobalValue(conf.supybot.commands, 'disabled', Disabled([], """Determines what commands are currently disabled. Such commands will not appear in command lists, etc. They will appear not even to exist.""")) - + class DisabledCommands(object): def __init__(self): self.d = CanonicalNameDict()