mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Changed validArgument to isValidArgument
This commit is contained in:
parent
771f07529f
commit
46eb87808f
@ -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.')
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user