mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Fix errors detected by PyLint.
This commit is contained in:
parent
8a5c4753d0
commit
77e6de6bba
@ -366,16 +366,6 @@ class Admin(callbacks.Plugin):
|
||||
clearq = wrap(clearq)
|
||||
|
||||
|
||||
@internationalizeDocstring
|
||||
def clearq(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
|
||||
Clears the current send queue for this network.
|
||||
"""
|
||||
irc.queue.reset()
|
||||
irc.replySuccess()
|
||||
|
||||
|
||||
|
||||
Class = Admin
|
||||
|
||||
|
@ -408,7 +408,6 @@ class Channel(callbacks.Plugin):
|
||||
self.log.warning('%q attempted kban without %s',
|
||||
msg.prefix, capability)
|
||||
irc.errorNoCapability(capability)
|
||||
exact,nick,user,host
|
||||
|
||||
@internationalizeDocstring
|
||||
def unban(self, irc, msg, args, channel, hostmask):
|
||||
|
@ -51,7 +51,7 @@ _ = PluginInternationalization('Config')
|
||||
def getWrapper(name):
|
||||
parts = registry.split(name)
|
||||
if not parts or parts[0] not in ('supybot', 'users'):
|
||||
raise InvalidRegistryName(name)
|
||||
raise registry.InvalidRegistryName(name)
|
||||
group = getattr(conf, parts.pop(0))
|
||||
while parts:
|
||||
try:
|
||||
|
@ -222,7 +222,7 @@ class Relay(callbacks.Plugin):
|
||||
if ops:
|
||||
L.append(format(_('is an op on %L'), ops))
|
||||
if halfops:
|
||||
L.append(format(_('is a halfop on %L'), halfups))
|
||||
L.append(format(_('is a halfop on %L'), halfops))
|
||||
if voices:
|
||||
L.append(format(_('is voiced on %L'), voices))
|
||||
if normal:
|
||||
|
@ -301,7 +301,7 @@ class ShrinkUrl(callbacks.PluginRegexp):
|
||||
self.db.set('ur1', url, ur1ca)
|
||||
return ur1ca
|
||||
else:
|
||||
raise ShrinkError(text)
|
||||
raise ShrinkError(response)
|
||||
|
||||
def ur1(self, irc, msg, args, url):
|
||||
"""<url>
|
||||
|
@ -354,11 +354,11 @@ class User(callbacks.Plugin):
|
||||
irc.error(str(e), Raise=True)
|
||||
try:
|
||||
ircdb.users.setUser(user)
|
||||
except ValueError as e:
|
||||
irc.error(str(e), Raise=True)
|
||||
except ircdb.DuplicateHostmask:
|
||||
irc.error(_('That hostmask is already registered.'),
|
||||
Raise=True)
|
||||
except ValueError as e:
|
||||
irc.error(str(e), Raise=True)
|
||||
irc.replySuccess()
|
||||
add = wrap(add, ['private', first('otherUser', 'user'),
|
||||
optional('something'), additional('something', '')])
|
||||
|
@ -150,7 +150,7 @@ class Debug(callbacks.Privmsg):
|
||||
given, sys.stdout is used. This causes much output.
|
||||
"""
|
||||
if filename:
|
||||
fd = file(filename, 'a')
|
||||
fd = open(filename, 'a')
|
||||
else:
|
||||
fd = sys.stdout
|
||||
sys.settrace(getTracer(fd))
|
||||
|
@ -774,7 +774,7 @@ class UsersDictionary(utils.IterableMap):
|
||||
self.nextId = max(self.nextId, user.id)
|
||||
try:
|
||||
if self.getUserId(user.name) != user.id:
|
||||
raise DuplicateHostmask(hostmask)
|
||||
raise DuplicateHostmask(user.name)
|
||||
except KeyError:
|
||||
pass
|
||||
for hostmask in user.hostmasks:
|
||||
|
@ -553,7 +553,7 @@ def kicks(channels, nicks, s='', prefix='', msg=None):
|
||||
if isinstance(channels, str): # Backward compatibility
|
||||
channels = [channels]
|
||||
if conf.supybot.protocols.irc.strictRfc():
|
||||
assert areChannels(channels), repr(channel)
|
||||
assert areChannels(channels), repr(channels)
|
||||
assert areNicks(nicks), repr(nicks)
|
||||
if msg and not prefix:
|
||||
prefix = msg.prefix
|
||||
@ -561,9 +561,11 @@ def kicks(channels, nicks, s='', prefix='', msg=None):
|
||||
s = s.encode('utf8')
|
||||
assert isinstance(s, str)
|
||||
if s:
|
||||
for channel in channels:
|
||||
return IrcMsg(prefix=prefix, command='KICK',
|
||||
args=(channel, ','.join(nicks), s), msg=msg)
|
||||
else:
|
||||
for channel in channels:
|
||||
return IrcMsg(prefix=prefix, command='KICK',
|
||||
args=(channel, ','.join(nicks)), msg=msg)
|
||||
|
||||
|
@ -35,6 +35,7 @@ Simple utility functions related to strings.
|
||||
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import string
|
||||
import textwrap
|
||||
|
||||
|
@ -53,6 +53,8 @@ class InProgress(error.Error):
|
||||
error.Error.__init__(self, msg, e)
|
||||
|
||||
|
||||
class InvalidCwd(Exception):
|
||||
pass
|
||||
class TransactionMixin(python.Object):
|
||||
JOURNAL = 'journal'
|
||||
ORIGINALS = 'originals'
|
||||
|
@ -55,7 +55,7 @@ def isMainThread():
|
||||
|
||||
threadsSpawned = 1 # Starts at one for the initial "thread."
|
||||
|
||||
class SupyThread(threading.Thread):
|
||||
class SupyThread(threading.Thread, object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
global threadsSpawned
|
||||
threadsSpawned += 1
|
||||
|
Loading…
Reference in New Issue
Block a user