Added repr command and fixed strsplit.

This commit is contained in:
Jeremy Fincher 2003-04-15 15:59:40 +00:00
parent 25d90d6e43
commit f67fa45395

View File

@ -48,8 +48,17 @@ class Utilities(callbacks.Privmsg):
def strjoin(self, irc, msg, args): def strjoin(self, irc, msg, args):
"<separator> <strings to join>" "<separator> <strings to join>"
sep = args.pop(0) sep = args.pop(0)
args = flatten(map(callbacks.tokenize, args))
irc.reply(msg, sep.join(args)) irc.reply(msg, sep.join(args))
def repr(self, irc, msg, args):
"""<text>
Returns the text surrounded by double quotes.
"""
text = privmsgs.getArgs(args)
irc.reply(msg, utils.dqrepr(text))
def strconcat(self, irc, msg, args): def strconcat(self, irc, msg, args):
"<string 1> <string 2>" "<string 1> <string 2>"
(first, second) = privmsgs.getArgs(args, needed=2) (first, second) = privmsgs.getArgs(args, needed=2)