Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : openlmi-tools-lmiwbem
---------------------------------------------------------------
commit 71b61ad7cffbb6b6579a098e4afafb0cc4483579
Author: Peter Hatina <phatina(a)redhat.com>
Date: Fri Jun 27 09:03:26 2014 +0200
make LMIClass::print_methods() more informative
---------------------------------------------------------------
cli/lmi/shell/LMIClass.py | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/cli/lmi/shell/LMIClass.py b/cli/lmi/shell/LMIClass.py
index 64e0319..4d800ee 100644
--- a/cli/lmi/shell/LMIClass.py
+++ b/cli/lmi/shell/LMIClass.py
@@ -415,7 +415,7 @@ class LMIClass(LMIWrapperBaseObject):
return methods_lst
- @lmi_class_fetch_lazy()
+ @lmi_class_fetch_lazy(True)
@lmi_return_if_fail(lambda obj: obj._namespace)
def print_methods(self):
"""
@@ -423,8 +423,21 @@ class LMIClass(LMIWrapperBaseObject):
**Usage:** See :ref:`class_methods`.
"""
- for method in self.methods():
- sys.stdout.write("%s\n" % method)
+ for name, method in self._cim_class.methods.iteritems():
+ in_params = [
+ "%s %s" % (param.type, pname)
+ for pname, param in method.parameters.iteritems()
+ if "Out" not in param.qualifiers or \
+ not param.qualifiers["Out"]]
+ out_params = [
+ "%s:%s" % (pname, param.type)
+ for pname, param in method.parameters.iteritems()
+ if "Out" in param.qualifiers and \
+ param.qualifiers["Out"]]
+ sys.stdout.write(
+ "LMIReturnValue(%s rval, rparams={%s}) %s(%s)\n" % (
+ method.return_type, ", ".join(out_params),
+ name, ", ".join(in_params)))
@property
def classname(self):