mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Cleaned up listCommands a bit.
This commit is contained in:
parent
2f928e9888
commit
180291dd34
@ -1012,6 +1012,7 @@ class Commands(object):
|
|||||||
|
|
||||||
def getCommandMethod(self, command):
|
def getCommandMethod(self, command):
|
||||||
"""Gets the given command from this plugin."""
|
"""Gets the given command from this plugin."""
|
||||||
|
assert not isinstance(command, basestring)
|
||||||
command = map(canonicalName, command)
|
command = map(canonicalName, command)
|
||||||
assert self.getCommand(command) == command
|
assert self.getCommand(command) == command
|
||||||
if len(command) == 2:
|
if len(command) == 2:
|
||||||
@ -1024,12 +1025,8 @@ class Commands(object):
|
|||||||
commands = []
|
commands = []
|
||||||
name = canonicalName(self.name())
|
name = canonicalName(self.name())
|
||||||
for s in dir(self):
|
for s in dir(self):
|
||||||
if self.isCommandMethod(s) and \
|
if self.isCommand(s):
|
||||||
(s != name or self._original) and \
|
commands.append(s)
|
||||||
s == canonicalName(s):
|
|
||||||
method = getattr(self, s)
|
|
||||||
if hasattr(method, '__doc__') and method.__doc__:
|
|
||||||
commands.append(s)
|
|
||||||
commands.sort()
|
commands.sort()
|
||||||
return commands
|
return commands
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user