diff --git a/plugins/Alias.py b/plugins/Alias.py index 5f056b119..a707049f4 100644 --- a/plugins/Alias.py +++ b/plugins/Alias.py @@ -144,7 +144,7 @@ def makeNewAlias(name, alias): everythingReplace(tokens) Owner = irc.getCallback('Owner') self.Proxy(irc.irc, msg, tokens) - doc ='\n\nAlias for %r' % \ + doc ='\n\nAlias for <<%s>>' % \ (utils.nItems('argument', biggestDollar), alias) f = utils.changeFunctionName(f, name, doc) return f diff --git a/src/Misc.py b/src/Misc.py index f2fceaf6e..f46dd3367 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -108,7 +108,7 @@ class Misc(callbacks.Privmsg): channel = msg.args[0] if conf.get(conf.supybot.reply.whenNotCommand, channel): command = tokens and tokens[0] or '' - irc.errorInvalid('command', command) + irc.errorInvalid('command', command, repr=False) else: if tokens: # echo [] will get us an empty token set, but there's no need diff --git a/src/callbacks.py b/src/callbacks.py index 3d3f2da70..fe2da53c8 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -479,13 +479,18 @@ class RichReplyMethods(object): v = self._getConfig(conf.supybot.replies.requiresPrivacy) self._error(self.__makeReply(v, s), **kwargs) - def errorInvalid(self, what, given=None, s='', **kwargs): + def errorInvalid(self, what, given=None, s='', repr=True, **kwargs): if given is not None: - v = '%r is not a valid %s.' % (given, what) + if repr: + given = _repr(given) + else: + given = '"%s"' % given + v = '%s is not a valid %s.' % (given, what) else: v = 'That\'s not a valid %s.' % what self._error(self.__makeReply(v, s), **kwargs) +_repr = repr class IrcObjectProxy(RichReplyMethods): "A proxy object to allow proper nested of commands (even threaded ones)."