1 # vim: set encoding=utf-8 et sw=4 sts=4 :
4 import logging ; log = logging.getLogger('pymin.service')
6 class LoadError(ImportError):
9 def load_service(name, search_paths):
10 log.debug('load_service(%s, %r)', name, search_paths)
12 (fp, path, desc) = imp.find_module(name, search_paths)
14 raise LoadError('module "%s" not found' % name)
16 log.debug('load_service() -> find_module() returned %r', (fp, path, desc))
18 m = imp.load_module(name, fp, path, desc)
19 log.debug('load_service() -> loaded module %r', m)
20 return imp.load_module(name, fp, path, desc)