diff options
author | makkalot <makkalot@gmail.com> | 2008-07-01 19:50:09 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-07-01 19:50:09 +0300 |
commit | 32096347a68f1c68e89299398c4a4e940ea5a9dd (patch) | |
tree | 5f2941d877c18f712707e17652fcbfe5b04060cb /funcweb | |
parent | c6bbf5292357e26badbe47d38e37c5c3ff924fed (diff) | |
download | func-32096347a68f1c68e89299398c4a4e940ea5a9dd.tar.gz func-32096347a68f1c68e89299398c4a4e940ea5a9dd.tar.xz func-32096347a68f1c68e89299398c4a4e940ea5a9dd.zip |
display only the methods that are registered with register_method api structure
Diffstat (limited to 'funcweb')
-rw-r--r-- | funcweb/funcweb/controllers.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/funcweb/funcweb/controllers.py b/funcweb/funcweb/controllers.py index 1970e54..298547e 100644 --- a/funcweb/funcweb/controllers.py +++ b/funcweb/funcweb/controllers.py @@ -69,7 +69,17 @@ class Root(controllers.RootController): return dict(minion=name, module=module, method=method, tg_template="funcweb.templates.method") else: # return a list of methods for specified module + + #display the list only that is registered with register_method template ! + registered_methods=getattr(fc,module).get_method_args()[name].keys() modules = getattr(fc, module).list_methods() + for mods in modules.itervalues(): + from copy import copy + cp_mods = copy(mods) + for m in cp_mods: + if not m in registered_methods: + mods.remove(m) + print modules return dict(modules=modules, module=module, tg_template="funcweb.templates.module") @@ -168,11 +178,8 @@ class Root(controllers.RootController): #assign them because we need the rest so dont control everytime #and dont make lookup everytime ... minion = kw['minion'] - del kw['minion'] module = kw['module'] - del kw['module'] method = kw['method'] - del kw['method'] #everytime we do that should be a clever way for that ??? fc = Overlord(minion) |