From 6d300c03206dd4cef3bd55e6370223d913e16638 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Fri, 21 Sep 2007 16:22:36 -0400 Subject: change to module loader to allow subdirs in the module path. This also implies that methods calls need a module as well (aka, you now have to call test.test_add instead of just test_add) but this also means you can setup modules/foo/bar/blip.py and blip.py exports a "do_blippy" method, which you would call by the name foo.bar.blip.do_blippy() Note, any subdir that has module files in it, will need an approriate __init__.py file. server.py, func_module.py: To do the above, we need to pass in the module_name to the register function, so we can associate it correctly. server.py also got a fix for a FuncException that needed tobe codes.FuncException --- modules/func_module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/func_module.py') diff --git a/modules/func_module.py b/modules/func_module.py index ec587c1..4bb06d2 100755 --- a/modules/func_module.py +++ b/modules/func_module.py @@ -35,9 +35,9 @@ class FuncModule(object): log = logger.Logger() self.logger = log.logger - def register_rpc(self, handlers): + def register_rpc(self, handlers, module_name): for meth in self.methods: - handlers[meth] = self.methods[meth] + handlers["%s.%s" % (module_name,meth)] = self.methods[meth] -- cgit