mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 11:04:05 +01:00
Aka: Tell in the help message what channel the aka is for.
This commit is contained in:
parent
0d7714d490
commit
087fa71d63
@ -507,8 +507,12 @@ class Aka(callbacks.Plugin):
|
||||
lock = ' ' + _('Locked by %s at %s') % (locked_by, locked_at)
|
||||
else:
|
||||
lock = ''
|
||||
doc = format(_('<an alias,%s %n>\n\nAlias for %q.%s'),
|
||||
if channel == 'global':
|
||||
doc = format(_('<a global alias,%s %n>\n\nAlias for %q.%s'),
|
||||
flexargs, (biggestDollar, _('argument')), original, lock)
|
||||
else:
|
||||
doc = format(_('<an alias on %s,%s %n>\n\nAlias for %q.%s'),
|
||||
channel, flexargs, (biggestDollar, _('argument')), original, lock)
|
||||
f = utils.python.changeFunctionName(f, name, doc)
|
||||
return f
|
||||
|
||||
|
@ -71,6 +71,12 @@ class AkaChannelTestCase(ChannelPluginTestCase):
|
||||
self.assertNotError('aka add nonascii echo éé')
|
||||
self.assertRegexp('help nonascii', "Alias for .*echo éé")
|
||||
|
||||
self.assertNotError('aka remove slashdot')
|
||||
self.assertNotError('aka add --channel %s slashdot foo' % self.channel)
|
||||
self.assertRegexp('help aka slashdot', "an alias on %s.*Alias for .*foo"
|
||||
% self.channel)
|
||||
self.assertNotError('aka remove --channel %s slashdot' % self.channel)
|
||||
|
||||
def testShow(self):
|
||||
self.assertNotError('aka add foo bar')
|
||||
self.assertResponse('show foo', 'bar $*')
|
||||
@ -211,7 +217,7 @@ class AkaTestCase(PluginTestCase):
|
||||
self.assertNotError('register evil_admin foo')
|
||||
|
||||
self.assertNotError('aka add slashdot foo')
|
||||
self.assertRegexp('help aka slashdot', "Alias for .*foo")
|
||||
self.assertRegexp('help aka slashdot', "a global alias.*Alias for .*foo")
|
||||
self.assertNotRegexp('help aka slashdot', 'Locked by')
|
||||
self.assertNotError('aka lock slashdot')
|
||||
self.assertRegexp('help aka slashdot', 'Locked by evil_admin')
|
||||
|
Loading…
Reference in New Issue
Block a user