mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11: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):
|
def reply(msg, s):
|
||||||
"""Makes a reply to msg with the payload s"""
|
"""Makes a reply to msg with the payload s"""
|
||||||
if ircutils.funkyArgument(s):
|
s = ircutils.safeArgument(s)
|
||||||
s = repr(s)
|
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if ircutils.isChannel(msg.args[0]):
|
||||||
m = ircmsgs.privmsg(msg.args[0], '%s: %s' % (msg.nick, s))
|
m = ircmsgs.privmsg(msg.args[0], '%s: %s' % (msg.nick, s))
|
||||||
else:
|
else:
|
||||||
@ -265,8 +264,7 @@ class IrcObjectProxy:
|
|||||||
if isinstance(self.irc, self.__class__):
|
if isinstance(self.irc, self.__class__):
|
||||||
self.irc.reply(msg, s)
|
self.irc.reply(msg, s)
|
||||||
else:
|
else:
|
||||||
if ircutils.funkyArgument(s):
|
s = ircutils.safeArgument(s)
|
||||||
s = repr(s)
|
|
||||||
self.irc.queueMsg(reply(msg, s))
|
self.irc.queueMsg(reply(msg, s))
|
||||||
else:
|
else:
|
||||||
self.args[self.counter] = s
|
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
|
return '\r' not in s and '\n' not in s and '\x00' not in s
|
||||||
|
|
||||||
notFunky = string.printable+'\x02'
|
notFunky = string.printable+'\x02'
|
||||||
def funkyArgument(s):
|
def safeArgument(s):
|
||||||
return validArgument(s) and s.translate(string.ascii, notFunky) != ''
|
if validArgument(s) and s.translate(string.ascii, notFunky) == s:
|
||||||
|
return s
|
||||||
|
else:
|
||||||
|
return repr(s)
|
||||||
|
|
||||||
def reply(msg):
|
def reply(msg):
|
||||||
if isChannel(msg.args[0]):
|
if isChannel(msg.args[0]):
|
||||||
|
Loading…
Reference in New Issue
Block a user