From 0ce71fe405dd7c9d27bcad2ddc558a29fec7c580 Mon Sep 17 00:00:00 2001 From: Ali Afshar Date: Wed, 23 Mar 2005 15:57:57 +0000 Subject: [PATCH] supybot-plugin-doc: added support for nested plugins command generation. --- scripts/supybot-plugin-doc | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/supybot-plugin-doc b/scripts/supybot-plugin-doc index 00c1a4cd6..c922e9419 100644 --- a/scripts/supybot-plugin-doc +++ b/scripts/supybot-plugin-doc @@ -81,14 +81,26 @@ class PluginDoc(object): log.debug('command: %s', command) self.appendLine(command, 2) self.appendLine('') - try: - help = inst.getCommandHelp([command]) - except AssertionError: - help = 'nested?' com = getattr(self.mod.Class, command, False) doc = None if com: doc = com.__doc__.splitlines() + else: + # this is a nested plugin + nclass = None + try: + nroot, nname = command.split() + except ValueError: + log.warning('Failed to find command, skipping %s', command) + break + nclass = getattr(self.mod.Class, nroot, False) + if nclass: + ncom = getattr(nclass, nname, False) + doc = ncom.__doc__.splitlines() + else: + log.warning('Failed to find nested pligun command, skipping %s', + command) + break if doc: args = doc.pop(0) doc = [l.strip() for l in doc] @@ -98,6 +110,7 @@ class PluginDoc(object): self.appendLine('') else: self.appendLine('No help Associated with this command', 3) + self.appendLine('') self.appendLine('') return '\n'.join(self.lines)