Uh, someone forgot to make the remainder of the changes necessary for the unColor -> stripColor conversion...

This commit is contained in:
Jeremy Fincher 2004-04-15 23:41:24 +00:00
parent b9ab839470
commit 99adf8511f
3 changed files with 5 additions and 5 deletions

View File

@ -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):
"""<text>
Returns <text> 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):
"""<text>

View File

@ -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 \

View File

@ -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."""