From a29c4b216ab5df83217c427e6aefe235641fc4a5 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 16 Dec 2004 07:56:57 +0000 Subject: [PATCH] Converted to use irc.isChannel rather than ircutils.isChannel. --- plugins/ChannelLogger.py | 6 +++--- plugins/Currency.py | 2 +- plugins/Dunno.py | 2 +- plugins/Factoids.py | 2 +- plugins/Karma.py | 4 ++-- plugins/LogToIrc.py | 2 +- plugins/Note.py | 4 ++-- plugins/Observer.py | 2 +- plugins/Protector.py | 2 +- plugins/QuoteGrabs.py | 2 +- plugins/RSS.py | 2 +- plugins/Relay.py | 2 +- plugins/Seen.py | 4 ++-- plugins/ShrinkUrl.py | 4 ++-- plugins/URL.py | 4 ++-- plugins/Weather.py | 2 +- plugins/WordStats.py | 2 +- plugins/Words.py | 2 +- 18 files changed, 25 insertions(+), 25 deletions(-) diff --git a/plugins/ChannelLogger.py b/plugins/ChannelLogger.py index 3ba1074c4..02369833b 100644 --- a/plugins/ChannelLogger.py +++ b/plugins/ChannelLogger.py @@ -234,7 +234,7 @@ class ChannelLogger(callbacks.Privmsg): def doPrivmsg(self, irc, msg): (recipients, text) = msg.args for channel in recipients.split(','): - if ircutils.isChannel(channel): + if irc.isChannel(channel): noLogPrefix = self.registryValue('noLogPrefix', channel) if noLogPrefix and text.startswith(noLogPrefix): text = '-= THIS MESSAGE NOT LOGGED =-' @@ -248,7 +248,7 @@ class ChannelLogger(callbacks.Privmsg): def doNotice(self, irc, msg): (recipients, text) = msg.args for channel in recipients.split(','): - if ircutils.isChannel(channel): + if irc.isChannel(channel): self.doLog(irc, channel, '-%s- %s\n' % (msg.nick, text)) def doNick(self, irc, msg): @@ -285,7 +285,7 @@ class ChannelLogger(callbacks.Privmsg): def doMode(self, irc, msg): channel = msg.args[0] - if ircutils.isChannel(channel) and msg.args[1:]: + if irc.isChannel(channel) and msg.args[1:]: self.doLog(irc, channel, '*** %s sets mode: %s %s\n' % (msg.nick or msg.prefix, msg.args[1], diff --git a/plugins/Currency.py b/plugins/Currency.py index 8a260840b..35a7fd57a 100644 --- a/plugins/Currency.py +++ b/plugins/Currency.py @@ -66,7 +66,7 @@ class Currency(callbacks.Privmsg): def convert(self, irc, msg, args): # This specifically does not have a docstring. channel = None - if ircutils.isChannel(msg.args[0]): + if irc.isChannel(msg.args[0]): channel = msg.args[0] realCommandName = self.registryValue('command', channel) realCommand = getattr(self, realCommandName) diff --git a/plugins/Dunno.py b/plugins/Dunno.py index 34e3c3fcb..939084182 100644 --- a/plugins/Dunno.py +++ b/plugins/Dunno.py @@ -73,7 +73,7 @@ class Dunno(plugins.ChannelIdDatabasePlugin): callAfter = ['MoobotFactoids'] def invalidCommand(self, irc, msg, tokens): channel = msg.args[0] - if ircutils.isChannel(channel): + if irc.isChannel(channel): dunno = self.db.random(channel) if dunno is not None: dunno = dunno.text diff --git a/plugins/Factoids.py b/plugins/Factoids.py index 92fc16f45..85bcf4240 100644 --- a/plugins/Factoids.py +++ b/plugins/Factoids.py @@ -188,7 +188,7 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg): irc.error('No factoid matches that key.') def tokenizedCommand(self, irc, msg, tokens): - if ircutils.isChannel(msg.args[0]): + if irc.isChannel(msg.args[0]): channel = msg.args[0] if self.registryValue('replyWhenInvalidCommand', channel): key = ' '.join(tokens) diff --git a/plugins/Karma.py b/plugins/Karma.py index da0f73ff7..e08f49075 100644 --- a/plugins/Karma.py +++ b/plugins/Karma.py @@ -287,7 +287,7 @@ class Karma(callbacks.Privmsg): def tokenizedCommand(self, irc, msg, tokens): channel = msg.args[0] - if not ircutils.isChannel(channel): + if not irc.isChannel(channel): return if tokens[-1][-2:] in ('++', '--'): thing = ' '.join(tokens) @@ -296,7 +296,7 @@ class Karma(callbacks.Privmsg): def doPrivmsg(self, irc, msg): if not msg.repliedTo: channel = msg.args[0] - if ircutils.isChannel(channel) and \ + if irc.isChannel(channel) and \ self.registryValue('allowUnaddressedKarma', channel): irc = callbacks.SimpleProxy(irc, msg) thing = msg.args[1].rstrip() diff --git a/plugins/LogToIrc.py b/plugins/LogToIrc.py index 6b44491a2..ce5499298 100644 --- a/plugins/LogToIrc.py +++ b/plugins/LogToIrc.py @@ -226,7 +226,7 @@ class LogToIrc(callbacks.Privmsg): def do376(self, irc, msg): targets = self.registryValue('targets') for target in targets: - if ircutils.isChannel(target): + if irc.isChannel(target): networkGroup = conf.supybot.networks.get(irc.network) irc.queueMsg(networkGroup.channels.join(target)) do377 = do422 = do376 diff --git a/plugins/Note.py b/plugins/Note.py index e9a509a39..b23359226 100644 --- a/plugins/Note.py +++ b/plugins/Note.py @@ -219,7 +219,7 @@ class Note(callbacks.Privmsg): specified by separating their names by commas. """ # Let's get the from user. - public = ircutils.isChannel(msg.args[0]) + public = irc.isChannel(msg.args[0]) sent = [] for target in targets: id = self.db.send(user.id, target.id, public, text) @@ -242,7 +242,7 @@ class Note(callbacks.Privmsg): 'that have been sent to you.', Raise=True) self.db.setRead(id) text += ' (in reply to #%s)' % id - public = ircutils.isChannel(msg.args[0]) + public = irc.isChannel(msg.args[0]) try: target = ircdb.users.getUser(note.frm) except KeyError: diff --git a/plugins/Observer.py b/plugins/Observer.py index 85dda3691..c3688fa35 100644 --- a/plugins/Observer.py +++ b/plugins/Observer.py @@ -143,7 +143,7 @@ class Observer(callbacks.Privmsg): # automatically pick the channel if the message is sent in # the channel itself. channel = args.pop(0) - if args or not ircutils.isChannel(channel): + if args or not irc.isChannel(channel): raise callbacks.ArgumentError observers = self.registryValue('observers.active', channel) # We don't sort because order matters. diff --git a/plugins/Protector.py b/plugins/Protector.py index 372543359..c4d96e73d 100644 --- a/plugins/Protector.py +++ b/plugins/Protector.py @@ -111,7 +111,7 @@ class Protector(callbacks.Privmsg): def __call__(self, irc, msg): if not msg.args: self.log.debug('Ignoring %r, no msg.args.', msg, irc) - elif not ircutils.isChannel(msg.args[0]): + elif not irc.isChannel(msg.args[0]): self.log.debug('Ignoring %r, not on a channel.', msg) elif msg.args[0] not in irc.state.channels: # One has to wonder how this would happen, but just in case... diff --git a/plugins/QuoteGrabs.py b/plugins/QuoteGrabs.py index 5de3225ec..3c8f4f737 100644 --- a/plugins/QuoteGrabs.py +++ b/plugins/QuoteGrabs.py @@ -212,7 +212,7 @@ class QuoteGrabs(callbacks.Privmsg): def doPrivmsg(self, irc, msg): irc = callbacks.SimpleProxy(irc, msg) - if ircutils.isChannel(msg.args[0]): + if irc.isChannel(msg.args[0]): (channel, payload) = msg.args words = self.registryValue('randomGrabber.minimumWords', channel) diff --git a/plugins/RSS.py b/plugins/RSS.py index b8a4e147a..11b24cfcc 100644 --- a/plugins/RSS.py +++ b/plugins/RSS.py @@ -371,7 +371,7 @@ class RSS(callbacks.Privmsg): """ self.log.debug('Fetching %s', url) feed = self.getFeed(url) - if ircutils.isChannel(msg.args[0]): + if irc.isChannel(msg.args[0]): channel = msg.args[0] else: channel = None diff --git a/plugins/Relay.py b/plugins/Relay.py index c59ee9a14..1d17334a3 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -398,7 +398,7 @@ class Relay(callbacks.Privmsg): def doPrivmsg(self, irc, msg): (channel, text) = msg.args - if ircutils.isChannel(channel): + if irc.isChannel(channel): irc = self._getRealIrc(irc) if channel not in self.registryValue('channels'): return diff --git a/plugins/Seen.py b/plugins/Seen.py index 337620805..0dc715bd5 100644 --- a/plugins/Seen.py +++ b/plugins/Seen.py @@ -104,7 +104,7 @@ class SeenDB(plugins.ChannelUserDB): def seen(self, channel, nickOrId): return self[channel, nickOrId] -filename = os.path.join(conf.supybot.directories.data(), 'Seen.db') +filename = conf.supybot.directories.data.dirize('Seen.db') class Seen(callbacks.Privmsg): noIgnore = True @@ -123,7 +123,7 @@ class Seen(callbacks.Privmsg): self.__parent.die() def doPrivmsg(self, irc, msg): - if ircutils.isChannel(msg.args[0]): + if irc.isChannel(msg.args[0]): said = ircmsgs.prettyPrint(msg) channel = msg.args[0] self.db.update(channel, msg.nick, said) diff --git a/plugins/ShrinkUrl.py b/plugins/ShrinkUrl.py index 582e6dab5..442ff0c1c 100644 --- a/plugins/ShrinkUrl.py +++ b/plugins/ShrinkUrl.py @@ -153,7 +153,7 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp): def outFilter(self, irc, msg): channel = msg.args[0] - if msg.command == 'PRIVMSG' and ircutils.isChannel(channel): + if msg.command == 'PRIVMSG' and irc.isChannel(channel): if not msg.shrunken: if self.registryValue('outFilter', channel): if webutils.httpUrlRe.search(msg.args[1]): @@ -164,7 +164,7 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp): def shrinkSnarfer(self, irc, msg, match): r"https?://[^\])>\s]{13,}" channel = msg.args[0] - if not ircutils.isChannel(channel): + if not irc.isChannel(channel): return if self.registryValue('shrinkSnarfer', channel): url = match.group(0) diff --git a/plugins/URL.py b/plugins/URL.py index 3fe0c03c8..5ee346d4b 100644 --- a/plugins/URL.py +++ b/plugins/URL.py @@ -100,7 +100,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp): def doPrivmsg(self, irc, msg): channel = msg.args[0] - if ircutils.isChannel(channel): + if irc.isChannel(channel): if ircmsgs.isAction(msg): text = ircmsgs.unAction(msg) else: @@ -118,7 +118,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp): def titleSnarfer(self, irc, msg, match): r"https?://[^\])>\s]+" channel = msg.args[0] - if not ircutils.isChannel(channel): + if not irc.isChannel(channel): return if callbacks.addressed(irc.nick, msg): return diff --git a/plugins/Weather.py b/plugins/Weather.py index f436d52b7..3e91ba590 100644 --- a/plugins/Weather.py +++ b/plugins/Weather.py @@ -110,7 +110,7 @@ class Weather(callbacks.Privmsg): def weather(self, irc, msg, args, location): # This specifically does not have a docstring. channel = None - if ircutils.isChannel(msg.args[0]): + if irc.isChannel(msg.args[0]): channel = msg.args[0] if not location: location = self.userValue('lastLocation', msg.prefix) diff --git a/plugins/WordStats.py b/plugins/WordStats.py index 417890279..19934eef3 100644 --- a/plugins/WordStats.py +++ b/plugins/WordStats.py @@ -196,7 +196,7 @@ class WordStats(callbacks.Privmsg): # This depends on the fact that it's called after the command. try: channel = msg.args[0] - if ircutils.isChannel(channel): + if irc.isChannel(channel): if not (self.queried and self.registryValue('ignoreQueries', channel)): self.db.addMsg(msg) diff --git a/plugins/Words.py b/plugins/Words.py index 3851b5a3f..f1d2bf9ad 100644 --- a/plugins/Words.py +++ b/plugins/Words.py @@ -183,7 +183,7 @@ class Words(callbacks.Privmsg): ### def tokenizedCommand(self, irc, msg, tokens): channel = msg.args[0] - if ircutils.isChannel(channel): + if irc.isChannel(channel): if channel in self.games: if len(tokens) == 1: c = tokens[0]