From 3a558433b95ff13eba34567ea1da7ebac405e649 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 23 Mar 2009 21:03:43 +0000 Subject: [PATCH] Fix plugin __init__'s and update create_plugin script --- deluge/plugins/blocklist/blocklist/__init__.py | 15 ++++++++++++--- deluge/plugins/example/example/__init__.py | 15 ++++++++++++--- deluge/plugins/label/label/__init__.py | 15 ++++++++++++--- deluge/scripts/create_plugin.py | 15 ++++++++++++--- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/deluge/plugins/blocklist/blocklist/__init__.py b/deluge/plugins/blocklist/blocklist/__init__.py index a87514d0b..06cb9dbd8 100644 --- a/deluge/plugins/blocklist/blocklist/__init__.py +++ b/deluge/plugins/blocklist/blocklist/__init__.py @@ -26,10 +26,19 @@ from deluge.plugins.init import PluginInitBase class CorePlugin(PluginInitBase): - from core import Core as _plugin_cls + def __init__(self, plugin_name): + from core import Core as _plugin_cls + self._plugin_cls = _plugin_cls + super(CorePlugin, self).__init__(plugin_name) class GtkUIPlugin(PluginInitBase): - from gtkui import GtkUI as _plugin_cls + def __init__(self, plugin_name): + from gtkui import GtkUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(GtkUIPlugin, self).__init__(plugin_name) class WebUIPlugin(PluginInitBase): - from webui import WebUI as _plugin_cls + def __init__(self, plugin_name): + from webui import WebUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(WebUIPlugin, self).__init__(plugin_name) diff --git a/deluge/plugins/example/example/__init__.py b/deluge/plugins/example/example/__init__.py index f9bf59cfe..823eba505 100644 --- a/deluge/plugins/example/example/__init__.py +++ b/deluge/plugins/example/example/__init__.py @@ -25,10 +25,19 @@ from deluge.plugins.init import PluginInitBase class CorePlugin(PluginInitBase): - from core import Core as _plugin_cls + def __init__(self, plugin_name): + from core import Core as _plugin_cls + self._plugin_cls = _plugin_cls + super(CorePlugin, self).__init__(plugin_name) class GtkUIPlugin(PluginInitBase): - from gtkui import GtkUI as _plugin_cls + def __init__(self, plugin_name): + from gtkui import GtkUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(GtkUIPlugin, self).__init__(plugin_name) class WebUIPlugin(PluginInitBase): - from webui import WebUI as _plugin_cls + def __init__(self, plugin_name): + from webui import WebUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(WebUIPlugin, self).__init__(plugin_name) diff --git a/deluge/plugins/label/label/__init__.py b/deluge/plugins/label/label/__init__.py index 26a8574e6..1c7353178 100644 --- a/deluge/plugins/label/label/__init__.py +++ b/deluge/plugins/label/label/__init__.py @@ -25,10 +25,19 @@ from deluge.plugins.init import PluginInitBase class CorePlugin(PluginInitBase): - from core import Core as _plugin_cls + def __init__(self, plugin_name): + from core import Core as _plugin_cls + self._plugin_cls = _plugin_cls + super(CorePlugin, self).__init__(plugin_name) class GtkUIPlugin(PluginInitBase): - from gtkui import GtkUI as _plugin_cls + def __init__(self, plugin_name): + from gtkui import GtkUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(GtkUIPlugin, self).__init__(plugin_name) class WebUIPlugin(PluginInitBase): - from webui import WebUI as _plugin_cls + def __init__(self, plugin_name): + from webui import WebUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(WebUIPlugin, self).__init__(plugin_name) diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py index dd2bedc9d..edb3dd8b0 100644 --- a/deluge/scripts/create_plugin.py +++ b/deluge/scripts/create_plugin.py @@ -135,13 +135,22 @@ INIT = """ from deluge.plugins.init import PluginInitBase class CorePlugin(PluginInitBase): - from core import Core as _plugin_cls + def __init__(self, plugin_name): + from core import Core as _plugin_cls + self._plugin_cls = _plugin_cls + super(CorePlugin, self).__init__(plugin_name) class GtkUIPlugin(PluginInitBase): - from gtkui import GtkUI as _plugin_cls + def __init__(self, plugin_name): + from gtkui import GtkUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(GtkUIPlugin, self).__init__(plugin_name) class WebUIPlugin(PluginInitBase): - from webui import WebUI as _plugin_cls + def __init__(self, plugin_name): + from webui import WebUI as _plugin_cls + self._plugin_cls = _plugin_cls + super(WebUIPlugin, self).__init__(plugin_name) """