From 8a7681aa5171a0747711a57f6da31f45494076bc Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 16 Sep 2004 14:51:40 +0000 Subject: [PATCH] We added the ability for a command to determine if it's nested or not, so we can make this prettier. --- src/Misc.py | 7 ++++++- test/test_Misc.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Misc.py b/src/Misc.py index 6d22433a2..936c191e8 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -403,7 +403,12 @@ class Misc(callbacks.Privmsg): if cbs: names = [cb.name() for cb in cbs] names.sort() - irc.reply(utils.commaAndify(names)) + plugin = utils.commaAndify(names) + if irc.nested: + irc.reply(utils.commaAndify(names)) + else: + irc.reply('The %s command is available in %s.' % + (command, plugin)) else: irc.error('There is no such command %s.' % command) diff --git a/test/test_Misc.py b/test/test_Misc.py index 589c1af07..7e997d162 100644 --- a/test/test_Misc.py +++ b/test/test_Misc.py @@ -152,7 +152,8 @@ class MiscTestCase(ChannelPluginTestCase): self.assertNotError('source') def testPlugin(self): - self.assertResponse('plugin plugin', 'Misc') + self.assertRegexp('plugin plugin', 'available.*Misc') + self.assertResponse('echo [plugin plugin]', 'Misc') def testTell(self): m = self.getMsg('tell foo [plugin tell]')