diff options
author | Adrian Likins <alikins@redhat.com> | 2007-09-21 16:22:36 -0400 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2007-09-21 16:22:36 -0400 |
commit | 6d300c03206dd4cef3bd55e6370223d913e16638 (patch) | |
tree | 5f7e7963036729b597e1cb6a0b59706be0fbae08 /modules/func_module.py | |
parent | 9467f2d3b478efe3a92a4531e46f0cb7b3f2f941 (diff) | |
download | func-6d300c03206dd4cef3bd55e6370223d913e16638.tar.gz func-6d300c03206dd4cef3bd55e6370223d913e16638.tar.xz func-6d300c03206dd4cef3bd55e6370223d913e16638.zip |
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
Diffstat (limited to 'modules/func_module.py')
-rwxr-xr-x | modules/func_module.py | 4 |
1 files changed, 2 insertions, 2 deletions
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] |