From d1772d410235592b482e3b08b1863f6624d9fe6b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 19 Feb 2023 15:52:21 +0100 Subject: Adding upstream version 2.0.3. Signed-off-by: Daniel Baumann --- deluge/plugins/init.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 deluge/plugins/init.py (limited to 'deluge/plugins/init.py') diff --git a/deluge/plugins/init.py b/deluge/plugins/init.py new file mode 100644 index 0000000..addeae9 --- /dev/null +++ b/deluge/plugins/init.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2007 Andrew Resch +# +# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with +# the additional special exception to link portions of this program with the OpenSSL library. +# See LICENSE for more details. +# + +""" +This base class is used in plugin's __init__ for the plugin entry points. +""" +from __future__ import unicode_literals + +import logging + +log = logging.getLogger(__name__) + + +class PluginInitBase(object): + _plugin_cls = None + + def __init__(self, plugin_name): + self.plugin = self._plugin_cls(plugin_name) # pylint: disable=not-callable + + def enable(self): + return self.plugin.enable() + + def disable(self): + return self.plugin.disable() -- cgit v1.2.3