def load_class(self, option):
package = self._package + '.' + option + self._suffix
try:
mod = import_module(package)
cls = getattr(mod, to_camel(option + self._suffix), '')
if not isclass(cls):
log.error('Class not callable:', cls)
else:
if hasattr(self, 'plugin_path'):
plugin_path = self.plugin_path + '.'
else:
plugin_path = ''
cls.attr_name = self.make_name(cls)
cls.plugin_path = plugin_path + cls.attr_name
return cls
except:
log.exception('Loading Module', package)
return None
评论列表
文章目录