mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 14:10:41 +01:00
Fix for bug #1019392.
This commit is contained in:
parent
bb4d3cda49
commit
ed71df8655
@ -143,8 +143,11 @@ def makeNewAlias(name, alias):
|
|||||||
return False
|
return False
|
||||||
everythingReplace(tokens)
|
everythingReplace(tokens)
|
||||||
Owner = irc.getCallback('Owner')
|
Owner = irc.getCallback('Owner')
|
||||||
Owner.disambiguate(irc, tokens)
|
d = Owner.disambiguate(irc, tokens)
|
||||||
self.Proxy(irc.irc, msg, tokens)
|
if d:
|
||||||
|
Owner.ambiguousError(irc, msg, d)
|
||||||
|
else:
|
||||||
|
self.Proxy(irc.irc, msg, tokens)
|
||||||
doc ='<an alias, %s>\n\nAlias for %r' % \
|
doc ='<an alias, %s>\n\nAlias for %r' % \
|
||||||
(utils.nItems('argument', biggestDollar), alias)
|
(utils.nItems('argument', biggestDollar), alias)
|
||||||
f = utils.changeFunctionName(f, name, doc)
|
f = utils.changeFunctionName(f, name, doc)
|
||||||
|
39
src/Owner.py
39
src/Owner.py
@ -320,27 +320,30 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
self.disambiguate(irc, elt, ambiguousCommands)
|
self.disambiguate(irc, elt, ambiguousCommands)
|
||||||
return ambiguousCommands
|
return ambiguousCommands
|
||||||
|
|
||||||
|
def ambiguousError(self, irc, msg, ambiguousCommands):
|
||||||
|
if len(ambiguousCommands) == 1: # Common case.
|
||||||
|
(command, names) = ambiguousCommands.popitem()
|
||||||
|
names.sort()
|
||||||
|
s = 'The command %r is available in the %s plugins. ' \
|
||||||
|
'Please specify the plugin whose command you ' \
|
||||||
|
'wish to call by using its name as a command ' \
|
||||||
|
'before calling it.' % \
|
||||||
|
(command, utils.commaAndify(names))
|
||||||
|
else:
|
||||||
|
L = []
|
||||||
|
for (command, names) in ambiguousCommands.iteritems():
|
||||||
|
names.sort()
|
||||||
|
L.append('The command %r is available in the %s '
|
||||||
|
'plugins' %
|
||||||
|
(command, utils.commaAndify(names)))
|
||||||
|
s = '%s; please specify from which plugins to ' \
|
||||||
|
'call these commands.' % '; '.join(L)
|
||||||
|
irc.queueMsg(callbacks.error(msg, s))
|
||||||
|
|
||||||
def processTokens(self, irc, msg, tokens):
|
def processTokens(self, irc, msg, tokens):
|
||||||
ambiguousCommands = self.disambiguate(irc, tokens)
|
ambiguousCommands = self.disambiguate(irc, tokens)
|
||||||
if ambiguousCommands:
|
if ambiguousCommands:
|
||||||
if len(ambiguousCommands) == 1: # Common case.
|
self.ambiguousError(irc, msg, ambiguousCommands)
|
||||||
(command, names) = ambiguousCommands.popitem()
|
|
||||||
names.sort()
|
|
||||||
s = 'The command %r is available in the %s plugins. ' \
|
|
||||||
'Please specify the plugin whose command you ' \
|
|
||||||
'wish to call by using its name as a command ' \
|
|
||||||
'before calling it.' % \
|
|
||||||
(command, utils.commaAndify(names))
|
|
||||||
else:
|
|
||||||
L = []
|
|
||||||
for (command, names) in ambiguousCommands.iteritems():
|
|
||||||
names.sort()
|
|
||||||
L.append('The command %r is available in the %s '
|
|
||||||
'plugins' %
|
|
||||||
(command, utils.commaAndify(names)))
|
|
||||||
s = '%s; please specify from which plugins to ' \
|
|
||||||
'call these commands.' % '; '.join(L)
|
|
||||||
irc.queueMsg(callbacks.error(msg, s))
|
|
||||||
else:
|
else:
|
||||||
callbacks.IrcObjectProxy(irc, msg, tokens)
|
callbacks.IrcObjectProxy(irc, msg, tokens)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user