mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Removed funkyArgument; now we use safeArgument which does the repr() itself.
This commit is contained in:
parent
10e8965f5d
commit
d5c5e1240b
@ -78,8 +78,7 @@ def canonicalName(command):
|
||||
|
||||
def reply(msg, s):
|
||||
"""Makes a reply to msg with the payload s"""
|
||||
if ircutils.funkyArgument(s):
|
||||
s = repr(s)
|
||||
s = ircutils.safeArgument(s)
|
||||
if ircutils.isChannel(msg.args[0]):
|
||||
m = ircmsgs.privmsg(msg.args[0], '%s: %s' % (msg.nick, s))
|
||||
else:
|
||||
@ -265,8 +264,7 @@ class IrcObjectProxy:
|
||||
if isinstance(self.irc, self.__class__):
|
||||
self.irc.reply(msg, s)
|
||||
else:
|
||||
if ircutils.funkyArgument(s):
|
||||
s = repr(s)
|
||||
s = ircutils.safeArgument(s)
|
||||
self.irc.queueMsg(reply(msg, s))
|
||||
else:
|
||||
self.args[self.counter] = s
|
||||
|
@ -161,8 +161,11 @@ def validArgument(s):
|
||||
return '\r' not in s and '\n' not in s and '\x00' not in s
|
||||
|
||||
notFunky = string.printable+'\x02'
|
||||
def funkyArgument(s):
|
||||
return validArgument(s) and s.translate(string.ascii, notFunky) != ''
|
||||
def safeArgument(s):
|
||||
if validArgument(s) and s.translate(string.ascii, notFunky) == s:
|
||||
return s
|
||||
else:
|
||||
return repr(s)
|
||||
|
||||
def reply(msg):
|
||||
if isChannel(msg.args[0]):
|
||||
|
Loading…
Reference in New Issue
Block a user