Made funkyArgument a bit more concise.

This commit is contained in:
Jeremy Fincher 2003-03-31 06:06:21 +00:00
parent 8fd1d71952
commit 817e967716

View File

@ -156,16 +156,9 @@ def bold(s):
def validArgument(s): def validArgument(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
nonFunkyArguments = string.printable+'\x02' notFunky = string.printable+'\x02'
def funkyArgument(s): def funkyArgument(s):
if validArgument(s): return validArgument(s) and s.translate(string.ascii, nonFunky) != ''
if s.translate(string.ascii, nonFunkyArguments) == '':
# All characters must be printable.
return False
else:
return True
else:
return True
def reply(msg): def reply(msg):
if isChannel(msg.args[0]): if isChannel(msg.args[0]):