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) """