summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-05-27 13:22:06 +0300
committermakkalot <makkalot@gmail.com>2008-05-27 13:22:06 +0300
commit7b9276ccd4958dc98099421a52278ccdaccbadb7 (patch)
tree072d4c00eacd02d920c4dce98d41446ecb196890 /func
parentfa76ae6a01f8740f831c400cccbb3cc744bfca40 (diff)
downloadthird_party-func-7b9276ccd4958dc98099421a52278ccdaccbadb7.tar.gz
third_party-func-7b9276ccd4958dc98099421a52278ccdaccbadb7.tar.xz
third_party-func-7b9276ccd4958dc98099421a52278ccdaccbadb7.zip
adding get_method_args for the minion part
Diffstat (limited to 'func')
-rw-r--r--func/minion/modules/func_module.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/func/minion/modules/func_module.py b/func/minion/modules/func_module.py
index 203b321..fd592c7 100644
--- a/func/minion/modules/func_module.py
+++ b/func/minion/modules/func_module.py
@@ -34,7 +34,8 @@ class FuncModule(object):
"module_version" : self.__module_version,
"module_api_version" : self.__module_api_version,
"module_description" : self.__module_description,
- "list_methods" : self.__list_methods
+ "list_methods" : self.__list_methods,
+ "get_method_args" : self.__get_method_args,
}
def __init_log(self):
@@ -88,4 +89,24 @@ class FuncModule(object):
@param meth_name: the name of the method
@retun : list or None
"""
- return None
+ if not self.__is_public_valid_method(name):
+ return {}
+
+ arg_names = inspect.getargspec(getattr(self,name))
+ #arg_names[0] is argument names
+ #arg_names[1] is *arg
+ #arg_names[2] is **kwarg
+ #arg_names[3] are defaults
+
+ name_dict =[other_args for other_args in arg_names[1:3] if other_args]
+ arg_names = arg_names[0] or []
+
+ #if we have self lets remove it
+ for rem in arg_names:
+ if rem=="self":
+ arg_names.remove(rem)
+ break
+
+ final_dict={}
+ final_dict[name]=arg_names+name_dict
+ return final_dict