diff --git a/deluge/plugins/testp/testp/__init__.py b/deluge/plugins/testp/testp/__init__.py index 0aeca2568..37219e170 100644 --- a/deluge/plugins/testp/testp/__init__.py +++ b/deluge/plugins/testp/testp/__init__.py @@ -41,14 +41,14 @@ class CorePlugin(PluginBase): try: from core import Core self.plugin = Core(plugin_api, plugin_name) - except: - pass + except Exception, e: + log.debug("Did not load a Core plugin: %s", e) class GtkUIPlugin(PluginBase): def __init__(self, plugin_api, plugin_name): # Load the GtkUI portion of the plugin try: from gtkui import GtkUI - self.plugin = GtkUI() - except: - pass + self.plugin = GtkUI(plugin_api, plugin_name) + except Exception, e: + log.debug("Did not load a GtkUI plugin: %s", e) diff --git a/deluge/plugins/testp/testp/gtkui.py b/deluge/plugins/testp/testp/gtkui.py index 9beb6e76d..220a4ef5b 100644 --- a/deluge/plugins/testp/testp/gtkui.py +++ b/deluge/plugins/testp/testp/gtkui.py @@ -35,9 +35,13 @@ from deluge.log import LOG as log import ui class GtkUI(ui.UI): - def __init__(self): - ui.UI.__init__(self) - log.debug("gtkui plugin initialized..") + def __init__(self, plugin_api, plugin_name): + log.debug("Calling UI init") + # Call UI constructor + ui.UI.__init__(self, plugin_api, plugin_name) + log.debug("test plugin initialized..") + self.plugin.register_hook("on_apply_prefs", self.apply_prefs) - + def apply_prefs(self): + log.debug("applying prefs in test plugin!!") diff --git a/deluge/plugins/testp/testp/ui.py b/deluge/plugins/testp/testp/ui.py index babd15a3e..92ea56ecf 100644 --- a/deluge/plugins/testp/testp/ui.py +++ b/deluge/plugins/testp/testp/ui.py @@ -34,8 +34,8 @@ from deluge.log import LOG as log class UI: - def __init__(self): - pass + def __init__(self, plugin_api, plugin_name): + self.plugin = plugin_api def enable(self): pass