From b6f2bcc48d610e35df3038a9cdf2c07c39f62000 Mon Sep 17 00:00:00 2001
From: Walter Purcaro <vuolter@gmail.com>
Date: Mon, 27 Oct 2014 23:03:29 +0100
Subject: [Plugin] Initial support for plugin deactivation

---
 module/plugins/Plugin.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

(limited to 'module/plugins')

diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 18f51aab7..8e5c01616 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -51,7 +51,6 @@ class Base(object):
     A Base class with log/config/db methods *all* plugin types can use
     """
 
-
     def __init__(self, core):
         #: Core instance
         self.core = core
@@ -143,23 +142,25 @@ class Plugin(Base):
     Base plugin for hoster/crypter.
     Overwrite `process` / `decrypt` in your subclassed plugin.
     """
-    __name__ = "Plugin"
-    __type__ = "hoster"
+    __name__    = "Plugin"
+    __type__    = "hoster"
     __version__ = "0.4"
 
     __pattern__ = None
-    __config__ = [("name", "type", "desc", "default")]
+    __config__  = []  #: [("name", "type", "desc", "default")]
 
     __description__ = """Base plugin"""
-    __license__ = "GPLv3"
-    __authors__ = [("RaNaN", "RaNaN@pyload.org"),
-                   ("spoob", "spoob@pyload.org"),
-                   ("mkaay", "mkaay@mkaay.de")]
+    __license__     = "GPLv3"
+    __authors__     = [("RaNaN", "RaNaN@pyload.org"),
+                       ("spoob", "spoob@pyload.org"),
+                       ("mkaay", "mkaay@mkaay.de")]
 
 
     def __init__(self, pyfile):
         Base.__init__(self, pyfile.m.core)
 
+        self.__config__.insert(("activated", "bool", "Activated", True))
+
         self.wantReconnect = False
         #: enables simultaneous processing of multiple downloads
         self.multiDL = True
@@ -313,7 +314,7 @@ class Plugin(Base):
         if not reason and not type:
             type = "unknown"
 
-        msg  = _("%s error") % type.strip().capitalize() if type else _("Error")
+        msg  = _("%s error") % _(type.strip().capitalize()) if type else _("Error")
         msg += ": " + reason.strip() if reason else ""
         msg += _(" | Plugin may be out of date")
 
-- 
cgit v1.2.3