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 /server/server.py | |
| parent | 9467f2d3b478efe3a92a4531e46f0cb7b3f2f941 (diff) | |
| download | third_party-func-6d300c03206dd4cef3bd55e6370223d913e16638.tar.gz third_party-func-6d300c03206dd4cef3bd55e6370223d913e16638.tar.xz third_party-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 'server/server.py')
| -rwxr-xr-x | server/server.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/server.py b/server/server.py index b167938..4e320e9 100755 --- a/server/server.py +++ b/server/server.py @@ -56,7 +56,7 @@ class XmlRpcInterface(object): self.handlers = {} for x in self.modules.keys(): try: - self.modules[x].register_rpc(self.handlers) + self.modules[x].register_rpc(self.handlers, x) self.logger.debug("adding %s" % x) except AttributeError, e: self.logger.warning("module %s not loaded, missing register_rpc method" % self.modules[x]) @@ -174,7 +174,7 @@ def main(argv): try: websvc = XmlRpcInterface(modules=modules) - except FuncException, e: + except codes.FuncException, e: print >> sys.stderr, 'error: %s' % e sys.exit(1) |
