diff --git a/plugins/Admin/plugin.py b/plugins/Admin/plugin.py index 4c8411695..c0c8e3815 100644 --- a/plugins/Admin/plugin.py +++ b/plugins/Admin/plugin.py @@ -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 diff --git a/plugins/Channel/plugin.py b/plugins/Channel/plugin.py index 44020c1cb..db1e057d4 100644 --- a/plugins/Channel/plugin.py +++ b/plugins/Channel/plugin.py @@ -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): diff --git a/plugins/Config/plugin.py b/plugins/Config/plugin.py index 8c4d11ab9..d7fa3e435 100644 --- a/plugins/Config/plugin.py +++ b/plugins/Config/plugin.py @@ -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: diff --git a/plugins/Relay/plugin.py b/plugins/Relay/plugin.py index 3224ac7e6..d4eed7229 100644 --- a/plugins/Relay/plugin.py +++ b/plugins/Relay/plugin.py @@ -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: diff --git a/plugins/ShrinkUrl/plugin.py b/plugins/ShrinkUrl/plugin.py index f9981a2f9..d073edabb 100644 --- a/plugins/ShrinkUrl/plugin.py +++ b/plugins/ShrinkUrl/plugin.py @@ -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): """ diff --git a/plugins/User/plugin.py b/plugins/User/plugin.py index bbab7552c..3a798a40b 100644 --- a/plugins/User/plugin.py +++ b/plugins/User/plugin.py @@ -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', '')]) diff --git a/sandbox/Debug/plugin.py b/sandbox/Debug/plugin.py index 672346e44..dcec24a9a 100644 --- a/sandbox/Debug/plugin.py +++ b/sandbox/Debug/plugin.py @@ -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)) diff --git a/src/ircdb.py b/src/ircdb.py index cd1a64b6c..497baabfe 100644 --- a/src/ircdb.py +++ b/src/ircdb.py @@ -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: diff --git a/src/ircmsgs.py b/src/ircmsgs.py index 325802f4a..20533bbe5 100644 --- a/src/ircmsgs.py +++ b/src/ircmsgs.py @@ -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,11 +561,13 @@ def kicks(channels, nicks, s='', prefix='', msg=None): s = s.encode('utf8') assert isinstance(s, str) if s: - return IrcMsg(prefix=prefix, command='KICK', - args=(channel, ','.join(nicks), s), msg=msg) + for channel in channels: + return IrcMsg(prefix=prefix, command='KICK', + args=(channel, ','.join(nicks), s), msg=msg) else: - return IrcMsg(prefix=prefix, command='KICK', - args=(channel, ','.join(nicks)), msg=msg) + for channel in channels: + return IrcMsg(prefix=prefix, command='KICK', + args=(channel, ','.join(nicks)), msg=msg) def privmsg(recipient, s, prefix='', msg=None): """Returns a PRIVMSG to recipient with the message msg.""" diff --git a/src/utils/str.py b/src/utils/str.py index 61387c970..a227ff7dc 100644 --- a/src/utils/str.py +++ b/src/utils/str.py @@ -35,6 +35,7 @@ Simple utility functions related to strings. import re import sys +import time import string import textwrap diff --git a/src/utils/transaction.py b/src/utils/transaction.py index 8a4e09d6b..ddae517c3 100644 --- a/src/utils/transaction.py +++ b/src/utils/transaction.py @@ -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' diff --git a/src/world.py b/src/world.py index a59a59973..933930fa0 100644 --- a/src/world.py +++ b/src/world.py @@ -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