From 648dc93655eb66fca20e132f328a2a82efb80500 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 22 Mar 2017 00:07:34 +0000 Subject: [PATCH] [#3003] [Label] Fix duplicate context menu entries --- deluge/pluginmanagerbase.py | 15 ++++++++------- .../deluge/plugins/label/gtkui/label_config.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/deluge/pluginmanagerbase.py b/deluge/pluginmanagerbase.py index bdaab5bae..8d249100a 100644 --- a/deluge/pluginmanagerbase.py +++ b/deluge/pluginmanagerbase.py @@ -179,8 +179,10 @@ class PluginManagerBase(object): return True def on_started_error(result, instance): - log.warn('Failed to start plugin: %s\n%s', plugin_name, result.getTraceback()) - component.deregister(instance.plugin) + log.error('Failed to start plugin: %s\n%s', plugin_name, + result.getTraceback(elideFrameworkCode=1, detail='brief')) + self.plugins[plugin_name.replace('-', ' ')] = instance + self.disable_plugin(plugin_name) return False return_d.addCallbacks(on_started, on_started_error, callbackArgs=[instance], errbackArgs=[instance]) @@ -207,22 +209,21 @@ class PluginManagerBase(object): d = defer.maybeDeferred(self.plugins[name].disable) except Exception as ex: log.error('Error when disabling plugin: %s', self.plugin._component_name) - log.exception(ex) + log.debug(ex) d = defer.succeed(False) def on_disabled(result): ret = True if isinstance(result, Failure): - log.error('Error when disabling plugin: %s', name) - log.exception(result.getTraceback()) + log.debug('Error when disabling plugin %s: %s', name, result.getTraceback()) ret = False try: component.deregister(self.plugins[name].plugin) del self.plugins[name] self.config['enabled_plugins'].remove(name) except Exception as ex: - log.error('Unable to disable plugin: %s', name) - log.exception(ex) + log.warning('Problems occured disabling plugin: %s', name) + log.debug(ex) ret = False else: log.info('Plugin %s disabled...', name) diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py b/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py index 22446e18f..e93ac07a0 100644 --- a/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py +++ b/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py @@ -31,7 +31,7 @@ class LabelConfig(object): def load(self): log.debug('Adding Label Preferences page') builder = Builder() - builder.add_from_file(self.get_resource('label_pref.glade')) + builder.add_from_file(self.get_resource('label_pref.ui')) self.plugin.add_preferences_page(_('Label'), builder.get_object('label_prefs_box')) self.plugin.register_hook('on_show_prefs', self.load_settings)