summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-28 01:09:59 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-28 01:09:59 +0200
commitecf37227de05c73b7ffe2da89a5eda1259a72543 (patch)
tree01936b0bd250d18a2939df73f71a30898740ff4b /module/plugins
parentMissed to bump up some plugin __version__ (diff)
downloadpyload-ecf37227de05c73b7ffe2da89a5eda1259a72543.tar.xz
Improve _log method
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/crypter/Dereferer.py6
-rw-r--r--module/plugins/crypter/XFileSharingProFolder.py6
-rw-r--r--module/plugins/hoster/XFileSharingPro.py6
-rw-r--r--module/plugins/internal/Captcha.py6
-rw-r--r--module/plugins/internal/Extractor.py6
-rw-r--r--module/plugins/internal/Hook.py7
-rw-r--r--module/plugins/internal/OCR.py6
-rw-r--r--module/plugins/internal/Plugin.py25
8 files changed, 37 insertions, 31 deletions
diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py
index addd161fc..9051abcc2 100644
--- a/module/plugins/crypter/Dereferer.py
+++ b/module/plugins/crypter/Dereferer.py
@@ -8,7 +8,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class Dereferer(SimpleCrypter):
__name__ = "Dereferer"
__type__ = "crypter"
- __version__ = "0.17"
+ __version__ = "0.18"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/.*?(?P<LINK>(?:ht|f)tps?://.+)'
@@ -24,8 +24,8 @@ class Dereferer(SimpleCrypter):
HOSTER_NAME = None
- def _log(self, type, args):
- return super(Dereferer, self)._log(type, (self.HOSTER_NAME,) + args)
+ def _log(self, level, plugintype, pluginname, messages):
+ return super(Dereferer, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages)
def init(self):
diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py
index c81123b7e..834843c71 100644
--- a/module/plugins/crypter/XFileSharingProFolder.py
+++ b/module/plugins/crypter/XFileSharingProFolder.py
@@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo
class XFileSharingProFolder(XFSCrypter):
__name__ = "XFileSharingProFolder"
__type__ = "crypter"
- __version__ = "0.09"
+ __version__ = "0.10"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+'
@@ -20,8 +20,8 @@ class XFileSharingProFolder(XFSCrypter):
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- def _log(self, level, args):
- return super(XFileSharingProFolder, self)._log(level, (self.HOSTER_NAME,) + args)
+ def _log(self, level, plugintype, pluginname, messages):
+ return super(XFileSharingProFolder, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages)
def init(self):
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index d7caf3097..42d4d637e 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
class XFileSharingPro(XFSHoster):
__name__ = "XFileSharingPro"
__type__ = "hoster"
- __version__ = "0.49"
+ __version__ = "0.50"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)'
@@ -21,8 +21,8 @@ class XFileSharingPro(XFSHoster):
URL_REPLACEMENTS = [("/embed-", "/")]
- def _log(self, level, args):
- return super(XFileSharingPro, self)._log(level, (self.HOSTER_NAME,) + args)
+ def _log(self, level, plugintype, pluginname, messages):
+ return super(XFileSharingPro, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages)
def init(self):
diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py
index db2d25a8a..486d92c19 100644
--- a/module/plugins/internal/Captcha.py
+++ b/module/plugins/internal/Captcha.py
@@ -10,7 +10,7 @@ from module.plugins.internal.Plugin import Plugin
class Captcha(Plugin):
__name__ = "Captcha"
__type__ = "captcha"
- __version__ = "0.34"
+ __version__ = "0.35"
__status__ = "testing"
__description__ = """Base anti-captcha plugin"""
@@ -34,8 +34,8 @@ class Captcha(Plugin):
pass
- def _log(self, level, args):
- return self.plugin._log(level, (self.__name__,) + args)
+ def _log(self, level, plugintype, pluginname, messages):
+ return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages)
def recognize(self, image):
diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py
index cf9a1f6e3..cbfae5a4d 100644
--- a/module/plugins/internal/Extractor.py
+++ b/module/plugins/internal/Extractor.py
@@ -22,7 +22,7 @@ class PasswordError(Exception):
class Extractor(Plugin):
__name__ = "Extractor"
__type__ = "extractor"
- __version__ = "0.27"
+ __version__ = "0.28"
__status__ = "testing"
__description__ = """Base extractor plugin"""
@@ -113,8 +113,8 @@ class Extractor(Plugin):
pass
- def _log(self, level, args):
- return self.plugin._log(level, (self.__name__,) + args)
+ def _log(self, level, plugintype, pluginname, messages):
+ return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages)
def check(self):
diff --git a/module/plugins/internal/Hook.py b/module/plugins/internal/Hook.py
index fbd6934ce..3d8fb0dde 100644
--- a/module/plugins/internal/Hook.py
+++ b/module/plugins/internal/Hook.py
@@ -6,7 +6,7 @@ from module.plugins.internal.Addon import Addon
class Hook(Addon):
__name__ = "Hook"
__type__ = "hook"
- __version__ = "0.10"
+ __version__ = "0.11"
__status__ = "testing"
__config__ = [] #: [("name", "type", "desc", "default")]
@@ -21,3 +21,8 @@ class Hook(Addon):
def __init__(self, core, manager):
super(Hook, self).__init__(core, manager)
self.init_periodical(10)
+
+
+ #@TODO: Remove in 0.4.10
+ def _log(self, level, plugintype, pluginname, messages):
+ return super(self.__name__, self)._log(level, plugintype, pluginname.replace("Hook", ""), messages)
diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py
index 37a33206f..998b3f040 100644
--- a/module/plugins/internal/OCR.py
+++ b/module/plugins/internal/OCR.py
@@ -21,7 +21,7 @@ from module.utils import save_join as fs_join
class OCR(Plugin):
__name__ = "OCR"
__type__ = "ocr"
- __version__ = "0.14"
+ __version__ = "0.15"
__status__ = "testing"
__description__ = """OCR base plugin"""
@@ -44,8 +44,8 @@ class OCR(Plugin):
pass
- def _log(self, level, args):
- return self.plugin._log(level, (self.__name__,) + args)
+ def _log(self, level, plugintype, pluginname, messages):
+ return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages)
def load_image(self, image):
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py
index fb62712fa..638a1ee1f 100644
--- a/module/plugins/internal/Plugin.py
+++ b/module/plugins/internal/Plugin.py
@@ -137,7 +137,7 @@ def chunks(iterable, size):
class Plugin(object):
__name__ = "Plugin"
__type__ = "hoster"
- __version__ = "0.15"
+ __version__ = "0.16"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -164,34 +164,35 @@ class Plugin(object):
pass
- def _log(self, level, args):
+ def _log(self, level, plugintype, pluginname, messages):
log = getattr(self.pyload.log, level)
- msg = encode(" | ".join((a if isinstance(a, basestring) else str(a)).strip() for a in args if a))
- log("%(type)s %(plugin)s%(id)s : %(msg)s" % {'type': self.__type__.upper(),
- 'plugin': self.__name__,
- 'id' : ("[%s]" % self.pyfile.id) if hasattr(self, 'pyfile') else "",
- 'msg' : msg})
+ msg = encode(" | ".join((a if isinstance(a, basestring) else str(a)).strip() for a in messages if a))
+ log("%(plugintype)s %(pluginname)s%(id)s : %(msg)s"
+ % {'plugintype': plugintype.upper(),
+ 'pluginname': pluginname,
+ 'id' : ("[%s]" % self.pyfile.id) if hasattr(self, 'pyfile') else "",
+ 'msg' : msg})
def log_debug(self, *args):
if self.pyload.debug:
- return self._log("debug", args)
+ return self._log("debug", self.__type__, self.__name__, args)
def log_info(self, *args):
- return self._log("info", args)
+ return self._log("info", self.__type__, self.__name__, args)
def log_warning(self, *args):
- return self._log("warning", args)
+ return self._log("warning", self.__type__, self.__name__, args)
def log_error(self, *args):
- return self._log("error", args)
+ return self._log("error", self.__type__, self.__name__, args)
def log_critical(self, *args):
- return self._log("critical", args)
+ return self._log("critical", self.__type__, self.__name__, args)
def set_config(self, option, value):