summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-08-04 02:41:11 -0600
committerRob Crittenden <rcritten@redhat.com>2009-08-05 12:18:51 -0400
commitc0f558d98b46df6131b221b746e8dc54787225e7 (patch)
treec4e39d94ed0a913cf618f5d6764f848e890a2fc2 /ipalib/cli.py
parentb7b9f9b6a66f75e838a3a60b105ac7d0f8197ed2 (diff)
downloadfreeipa-c0f558d98b46df6131b221b746e8dc54787225e7.tar.gz
freeipa-c0f558d98b46df6131b221b746e8dc54787225e7.tar.xz
freeipa-c0f558d98b46df6131b221b746e8dc54787225e7.zip
Removed PluginProxy and all its uses
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 3258556b9..5f7822357 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -491,12 +491,15 @@ class help(frontend.Command):
_PLUGIN_BASE_MODULE = 'ipalib.plugins'
- def _get_command_module(self, cmd_plugin_proxy):
+ def _get_command_module(self, module):
"""
- Return bare module name where command represented by PluginProxy
- instance is defined. Return None if command isn't defined in
- a plugin module (we consider these commands to be builtins).
+ Return last part of ``module`` name, or ``None`` if module is this file.
+
+ For example:
"""
+ if module == __name__:
+ return
+ return module.split('.')[-1]
# get representation in the form of 'base_module.bare_module.command()'
r = repr(cmd_plugin_proxy)
# skip base module part and the following dot
@@ -517,7 +520,7 @@ class help(frontend.Command):
# build help topics
for c in self.Command():
- topic = self._get_command_module(c)
+ topic = self._get_command_module(c.module)
if topic:
self._topics.setdefault(topic, [0]).append(c)
# compute maximum length of command in topic
@@ -528,7 +531,7 @@ class help(frontend.Command):
# compute maximum topic length
self._mtl = max(
- len(s) for s in (self._topics.keys() + self._builtins)
+ len(s) for s in (self._topics.keys() + [c.name for c in self._builtins])
)
super(help, self).finalize()