mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-24 03:29:28 +01:00
pylint cleanups
This commit is contained in:
parent
3e1be1858b
commit
efb7891f46
@ -96,7 +96,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
channel limit. <channel> is only necessary if the message isn't sent
|
channel limit. <channel> is only necessary if the message isn't sent
|
||||||
in the channel itself.
|
in the channel itself.
|
||||||
"""
|
"""
|
||||||
limit = privmsg.getArgs(args)
|
limit = privmsgs.getArgs(args)
|
||||||
try:
|
try:
|
||||||
limit = int(limit)
|
limit = int(limit)
|
||||||
if limit < 0:
|
if limit < 0:
|
||||||
@ -122,7 +122,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
if self.haveOps(irc, channel, 'moderate the channel'):
|
if self.haveOps(irc, channel, 'moderate the channel'):
|
||||||
irc.queueMsg(ircmsgs.mode(channel, ['+m']))
|
irc.queueMsg(ircmsgs.mode(channel, ['+m']))
|
||||||
moderate = privmsgs.checkChannelCapability(moderate, 'op')
|
moderate = privmsgs.checkChannelCapability(moderate, 'op')
|
||||||
|
|
||||||
def unmoderate(self, irc, msg, args, channel):
|
def unmoderate(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
if self.haveOps(irc, channel, 'unset the keyword'):
|
if self.haveOps(irc, channel, 'unset the keyword'):
|
||||||
irc.queueMsg(ircmsgs.mode(channel, ['-k']))
|
irc.queueMsg(ircmsgs.mode(channel, ['-k']))
|
||||||
key = privmsgs.checkChannelCapability(key, 'op')
|
key = privmsgs.checkChannelCapability(key, 'op')
|
||||||
|
|
||||||
def op(self, irc, msg, args, channel):
|
def op(self, irc, msg, args, channel):
|
||||||
"""[<channel>] [<nick> ...]
|
"""[<channel>] [<nick> ...]
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ conf.supybot.plugins.Owner.register('public', registry.Boolean(True,
|
|||||||
###
|
###
|
||||||
# supybot.commands.
|
# supybot.commands.
|
||||||
###
|
###
|
||||||
|
|
||||||
conf.registerGroup(conf.supybot.commands, 'defaultPlugins')
|
conf.registerGroup(conf.supybot.commands, 'defaultPlugins')
|
||||||
conf.supybot.commands.defaultPlugins.help = utils.normalizeWhitespace("""
|
conf.supybot.commands.defaultPlugins.help = utils.normalizeWhitespace("""
|
||||||
Determines what commands have default plugins set, and which plugins are set to
|
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. '
|
self.log.error('Error loading src/ plugin %s. '
|
||||||
'This is usually rather '
|
'This is usually rather '
|
||||||
'serious; these plugins are '
|
'serious; these plugins are '
|
||||||
'almost always be loaded.', s)
|
'almost always be loaded.',
|
||||||
|
name)
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.exception('Failed to load %s:', name)
|
log.exception('Failed to load %s:', name)
|
||||||
else:
|
else:
|
||||||
@ -650,7 +651,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
setattr(cb.__class__, name, method)
|
setattr(cb.__class__, name, method)
|
||||||
delattr(cb.__class__, command)
|
delattr(cb.__class__, command)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ class RichReplyMethods(object):
|
|||||||
else:
|
else:
|
||||||
log.warning('Denying %s for some unspecified capability '
|
log.warning('Denying %s for some unspecified capability '
|
||||||
'(or a default)', self.msg.prefix)
|
'(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)
|
self.error(self.__makeReply(v, s), **kwargs)
|
||||||
|
|
||||||
def errorPossibleBug(self, s='', **kwargs):
|
def errorPossibleBug(self, s='', **kwargs):
|
||||||
@ -751,7 +751,7 @@ class CanonicalString(registry.NormalizedString):
|
|||||||
class CanonicalNameSet(utils.NormalizingSet):
|
class CanonicalNameSet(utils.NormalizingSet):
|
||||||
def normalize(self, s):
|
def normalize(self, s):
|
||||||
return canonicalName(s)
|
return canonicalName(s)
|
||||||
|
|
||||||
class CanonicalNameDict(utils.InsensitivePreservingDict):
|
class CanonicalNameDict(utils.InsensitivePreservingDict):
|
||||||
def key(self, s):
|
def key(self, s):
|
||||||
return canonicalName(s)
|
return canonicalName(s)
|
||||||
@ -759,12 +759,12 @@ class CanonicalNameDict(utils.InsensitivePreservingDict):
|
|||||||
class Disabled(registry.SpaceSeparatedListOf):
|
class Disabled(registry.SpaceSeparatedListOf):
|
||||||
Value = CanonicalString
|
Value = CanonicalString
|
||||||
List = CanonicalNameSet
|
List = CanonicalNameSet
|
||||||
|
|
||||||
conf.registerGlobalValue(conf.supybot.commands, 'disabled',
|
conf.registerGlobalValue(conf.supybot.commands, 'disabled',
|
||||||
Disabled([], """Determines what commands are currently disabled. Such
|
Disabled([], """Determines what commands are currently disabled. Such
|
||||||
commands will not appear in command lists, etc. They will appear not even
|
commands will not appear in command lists, etc. They will appear not even
|
||||||
to exist."""))
|
to exist."""))
|
||||||
|
|
||||||
class DisabledCommands(object):
|
class DisabledCommands(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.d = CanonicalNameDict()
|
self.d = CanonicalNameDict()
|
||||||
|
Loading…
Reference in New Issue
Block a user