mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +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)
|
text = privmsgs.getArgs(args)
|
||||||
s = base64.encodestring(text).strip()
|
s = base64.encodestring(text).strip()
|
||||||
if ircutils.validArgument(s):
|
if ircutils.isValidArgument(s):
|
||||||
irc.reply(msg, s)
|
irc.reply(msg, s)
|
||||||
else:
|
else:
|
||||||
irc.error(msg, 'Base64 requires a newline in that string. '\
|
irc.error(msg, 'Base64 requires a newline in that string. '\
|
||||||
@ -176,7 +176,7 @@ class Moobot(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
text = privmsgs.getArgs(args)
|
text = privmsgs.getArgs(args)
|
||||||
s = base64.decodestring(text)
|
s = base64.decodestring(text)
|
||||||
if ircutils.validArgument(s):
|
if ircutils.isValidArgument(s):
|
||||||
irc.reply(msg, s)
|
irc.reply(msg, s)
|
||||||
else:
|
else:
|
||||||
irc.error(msg, 'I can\'t send \\n, \\r, or \\0.')
|
irc.error(msg, 'I can\'t send \\n, \\r, or \\0.')
|
||||||
|
@ -157,12 +157,12 @@ def separateModes(args):
|
|||||||
def bold(s):
|
def bold(s):
|
||||||
return "\x02%s\x02" % 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
|
return '\r' not in s and '\n' not in s and '\x00' not in s
|
||||||
|
|
||||||
notFunky = string.printable+'\x02'
|
notFunky = string.printable+'\x02'
|
||||||
def safeArgument(s):
|
def safeArgument(s):
|
||||||
if validArgument(s) and s.translate(string.ascii, notFunky) == '':
|
if isValidArgument(s) and s.translate(string.ascii, notFunky) == '':
|
||||||
return s
|
return s
|
||||||
else:
|
else:
|
||||||
return repr(s)
|
return repr(s)
|
||||||
|
Loading…
Reference in New Issue
Block a user