Changed validArgument to isValidArgument

This commit is contained in:
Jeremy Fincher 2003-04-04 06:08:36 +00:00
parent 771f07529f
commit 46eb87808f
2 changed files with 4 additions and 4 deletions

View File

@ -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.')

View File

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