def __get_plugin(self, plugin_description):
try:
if isinstance(plugin_description, Hashable) and plugin_description is not None:
if plugin_description in self.saved_plugins:
return self.saved_plugins[plugin_description]
raise RuntimeError("Plugin not previously defined")
elif isinstance(plugin_description, dict):
return Plugin.plugin(plugin_description)
raise RuntimeError("Plugin description not dict or Hashable")
except RuntimeError as ex:
exception_string = "\n\t".join(str(ex).splitlines())
self.logger.warn("Could not instantiate plugin from: "+str(plugin_description)+exception_string)
评论列表
文章目录