From 99adf8511fcd7926af3126b0c15c09b127d488b9 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 15 Apr 2004 23:41:24 +0000 Subject: [PATCH] Uh, someone forgot to make the remainder of the changes necessary for the unColor -> stripColor conversion... --- plugins/Filter.py | 4 ++-- plugins/Relay.py | 2 +- src/ircutils.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/Filter.py b/plugins/Filter.py index c439cc1cd..d31bc110a 100644 --- a/plugins/Filter.py +++ b/plugins/Filter.py @@ -345,13 +345,13 @@ class Filter(callbacks.Privmsg): L = [self._color(c) for c in text] irc.reply('%s%s' % (''.join(L), '\x03')) - def colorstrip(self, irc, msg, args): + def stripcolor(self, irc, msg, args): """ Returns stripped of all color codes. """ text = privmsgs.getArgs(args) - irc.reply(ircutils.unColor(text)) + irc.reply(ircutils.stripColor(text)) def jeffk(self, irc, msg, args): """ diff --git a/plugins/Relay.py b/plugins/Relay.py index 358380079..ae9059017 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -617,7 +617,7 @@ class Relay(callbacks.Privmsg): abbreviations = self.abbreviations.values() rPrivmsg = re.compile(r'<[^@]+@(?:%s)>' % '|'.join(abbreviations)) rAction = re.compile(r'\* [^/]+@(?:%s) ' % '|'.join(abbreviations)) - text = ircutils.unColor(msg.args[1]) + text = ircutils.stripColor(msg.args[1]) if not (rPrivmsg.match(text) or \ rAction.match(text) or \ 'has left on ' in text or \ diff --git a/src/ircutils.py b/src/ircutils.py index 9a68d2499..1fc2ed41a 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -325,10 +325,10 @@ def stripBold(s): """Returns the string s, with bold removed.""" return s.replace('\x02', '') -_unColorRe = re.compile(r'\x03(?:\d{1,2},\d{1,2}|\d{1,2}|,\d{1,2}|)') +_stripColorRe = re.compile(r'\x03(?:\d{1,2},\d{1,2}|\d{1,2}|,\d{1,2}|)') def stripColor(s): """Returns the string s, with color removed.""" - return _unColorRe.sub('', s) + return _stripColorRe.sub('', s) def stripReverse(s): """Returns the string s, with reverse-video removed."""