def __init__(self, application, load_dirs, standard_classes): self._load_errors = [] self.plugins = [ PluginFactory(application, cls) for cls in standard_classes + self._find_classes(load_dirs) ] # print("DEBUG: PluginLoader plugins:%s" % self.plugins) if self._load_errors: LOG.error('\n\n'.join(self._load_errors))
def _execute(self, method): try: method() except Exception, err: self.SetValue(False) self.Enable(False) msg = "Failed to %s plugin %s:\n%s" % (method.__name__, self._plugin.name, err) self._plugin.error = err self._plugin.doc = msg LOG.error(msg) RideLogException(message=msg, exception=err, level="ERROR").publish()
def _execute(self, method): try: method() except Exception, err: self.SetValue(False) self.Enable(False) msg = 'Failed to %s plugin %s:\n%s'\ % (method.__name__, self._plugin.name, err) self._plugin.error = err self._plugin.doc = msg LOG.error(msg) RideLogException(message=msg, exception=err, level='ERROR').publish()
def __init__(self, error_msg, traceback, plugin_class): name = utils.name_from_class(plugin_class, 'Plugin') doc = 'This plugin is disabled because it failed to load properly.\n' \ + 'Error: ' + error_msg + '\n' + traceback _PluginConnector.__init__(self, name, doc=doc, error=error_msg) LOG.error("Taking %s plugin into use failed:\n%s" % (name, error_msg))
def __init__(self, error, plugin_class): name = utils.name_from_class(plugin_class, 'Plugin') doc = 'This plugin is disabled because it failed to load properly.\n' \ + 'Error: ' + error _PluginConnector.__init__(self, name, doc=doc, error=error) LOG.error("Taking %s plugin into use failed:\n%s" % (name, error))
def __init__(self, application, load_dirs, standard_classes): self._load_errors = [] self.plugins = [PluginFactory(application, cls) for cls in standard_classes + self._find_classes(load_dirs)] if self._load_errors: LOG.error("\n\n".join(self._load_errors))