From 46eb87808fd63f73efd225ba78861e2dbe543798 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 4 Apr 2003 06:08:36 +0000 Subject: [PATCH] Changed validArgument to isValidArgument --- plugins/Moobot.py | 4 ++-- src/ircutils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Moobot.py b/plugins/Moobot.py index 1b7c70230..79c127519 100644 --- a/plugins/Moobot.py +++ b/plugins/Moobot.py @@ -162,7 +162,7 @@ class Moobot(callbacks.Privmsg): """ text = privmsgs.getArgs(args) s = base64.encodestring(text).strip() - if ircutils.validArgument(s): + if ircutils.isValidArgument(s): irc.reply(msg, s) else: irc.error(msg, 'Base64 requires a newline in that string. '\ @@ -176,7 +176,7 @@ class Moobot(callbacks.Privmsg): """ text = privmsgs.getArgs(args) s = base64.decodestring(text) - if ircutils.validArgument(s): + if ircutils.isValidArgument(s): irc.reply(msg, s) else: irc.error(msg, 'I can\'t send \\n, \\r, or \\0.') diff --git a/src/ircutils.py b/src/ircutils.py index ae31d4d34..1efc50dee 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -157,12 +157,12 @@ def separateModes(args): def bold(s): return "\x02%s\x02" % s -def validArgument(s): +def isValidArgument(s): return '\r' not in s and '\n' not in s and '\x00' not in s notFunky = string.printable+'\x02' def safeArgument(s): - if validArgument(s) and s.translate(string.ascii, notFunky) == '': + if isValidArgument(s) and s.translate(string.ascii, notFunky) == '': return s else: return repr(s)