def discover_plugins(self): for source in self._get_hook_sources(): for h in [h for h in glob.glob(os.path.join(source, '*.py')) if not os.path.basename(h).startswith('_')]: name = os.path.basename(os.path.splitext(h)[0]) p = self.new_plugin( name=name, package_dir=os.path.dirname(h), entry_module=name) self.add_plugin(p) logger.info(u"discovered hook '%s'" % name) return True
def task___load_enabled_plugins__(self): for plugin in self.meta.get_enabled_plugins_list(): self._load_plugin(plugin) logger.info("loaded plugin '%s'" % plugin.name)