From 180291dd343f7e82f7de45a01008f4c9c08b7348 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 18 Feb 2005 06:30:46 +0000 Subject: [PATCH] Cleaned up listCommands a bit. --- src/callbacks.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index fc0dfd8a9..cc14d262f 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -1012,6 +1012,7 @@ class Commands(object): def getCommandMethod(self, command): """Gets the given command from this plugin.""" + assert not isinstance(command, basestring) command = map(canonicalName, command) assert self.getCommand(command) == command if len(command) == 2: @@ -1024,12 +1025,8 @@ class Commands(object): commands = [] name = canonicalName(self.name()) for s in dir(self): - if self.isCommandMethod(s) and \ - (s != name or self._original) and \ - s == canonicalName(s): - method = getattr(self, s) - if hasattr(method, '__doc__') and method.__doc__: - commands.append(s) + if self.isCommand(s): + commands.append(s) commands.sort() return commands