From fd78cbaf22650c3061368684859925f58c005620 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 May 2008 10:12:07 +0300 Subject: First commit in gsoc,reusing public method validation in func_module --- func/minion/modules/func_module.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/func/minion/modules/func_module.py b/func/minion/modules/func_module.py index 7d476dc..693d808 100644 --- a/func/minion/modules/func_module.py +++ b/func/minion/modules/func_module.py @@ -58,8 +58,7 @@ class FuncModule(object): """ handlers = {} for attr in dir(self): - if inspect.ismethod(getattr(self, attr)) and attr[0] != '_' and \ - attr != 'register_rpc': + if self.__is_public_valid_method(attr): handlers[attr] = getattr(self, attr) return handlers @@ -74,3 +73,10 @@ class FuncModule(object): def __module_description(self): return self.description + + def __is_public_valid_method(self,attr): + if inspect.ismethod(getattr(self, attr)) and attr[0] != '_' and\ + attr != 'register_rpc': + return True + return False + -- cgit