diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-29 08:40:17 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-29 08:40:17 +0200 |
commit | e42f5783442fcbaa53e6c0faf943dd33c397e0b3 (patch) | |
tree | d5929a9bd2618320eee2a4f08bd67b258cef9de6 | |
parent | Fix https://github.com/pyload/pyload/issues/1588 (diff) | |
download | pyload-e42f5783442fcbaa53e6c0faf943dd33c397e0b3.tar.xz |
Fix _log method
-rw-r--r-- | module/plugins/crypter/LinkdecrypterCom.py | 6 | ||||
-rw-r--r-- | module/plugins/crypter/XFileSharingProFolder.py | 7 | ||||
-rw-r--r-- | module/plugins/hoster/XFileSharingPro.py | 7 | ||||
-rw-r--r-- | module/plugins/internal/MultiCrypter.py | 29 | ||||
-rw-r--r-- | module/plugins/internal/MultiHoster.py | 15 | ||||
-rw-r--r-- | module/plugins/internal/OCR.py | 7 | ||||
-rw-r--r-- | module/plugins/internal/Plugin.py | 4 |
7 files changed, 63 insertions, 12 deletions
diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 242899c33..d8812dbd5 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -2,13 +2,13 @@ import re -from module.plugins.internal.Crypter import Crypter +from module.plugins.internal.MultiCrypter import MultiCrypter -class LinkdecrypterCom(Crypter): +class LinkdecrypterCom(MultiCrypter): __name__ = "LinkdecrypterCom" __type__ = "crypter" - __version__ = "0.31" + __version__ = "0.32" __status__ = "testing" __pattern__ = r'^unmatchable$' diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 834843c71..1340faf35 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.10" + __version__ = "0.11" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' @@ -21,7 +21,10 @@ class XFileSharingProFolder(XFSCrypter): def _log(self, level, plugintype, pluginname, messages): - return super(XFileSharingProFolder, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages) + return super(XFileSharingProFolder, self)._log(level, + plugintype, + "%s: %s" % (pluginname, self.HOSTER_NAME), + messages) def init(self): diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 42d4d637e..1613a9a5c 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.50" + __version__ = "0.51" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -22,7 +22,10 @@ class XFileSharingPro(XFSHoster): def _log(self, level, plugintype, pluginname, messages): - return super(XFileSharingPro, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages) + return super(XFileSharingPro, self)._log(level, + plugintype, + "%s: %s" % (pluginname, self.HOSTER_NAME), + messages) def init(self): diff --git a/module/plugins/internal/MultiCrypter.py b/module/plugins/internal/MultiCrypter.py new file mode 100644 index 000000000..5771e7e96 --- /dev/null +++ b/module/plugins/internal/MultiCrypter.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class MultiCrypter(SimpleCrypter): + __name__ = "MultiCrypter" + __type__ = "hoster" + __version__ = "0.01" + __status__ = "testing" + + __pattern__ = r'^unmatchable$' + __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), + ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] + + __description__ = """Multi decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + def init(self): + self.CRYPTER_NAME = self.pyload.pluginManager.crypterPlugins[self.__name__]['name'] + + + def _log(self, level, plugintype, pluginname, messages): + return super(MultiCrypter, self)._log(level, + plugintype, + "%s: %s" % (pluginname, self.CRYPTER_NAME), + messages) diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index 06466e286..5dcdfa46b 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, r class MultiHoster(SimpleHoster): __name__ = "MultiHoster" __type__ = "hoster" - __version__ = "0.47" + __version__ = "0.48" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -21,10 +21,23 @@ class MultiHoster(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + HOSTER_NAME = None + LEECH_HOSTER = False LOGIN_ACCOUNT = True + def init(self): + self.HOSTER_NAME = self.pyload.pluginManager.hosterPlugins[self.__name__]['name'] + + + def _log(self, level, plugintype, pluginname, messages): + return super(MultiHoster, self)._log(level, + plugintype, + "%s: %s" % (pluginname, self.HOSTER_NAME), + messages) + + def setup(self): self.chunk_limit = 1 self.multiDL = bool(self.account) diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py index 998b3f040..8eb240051 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.15" + __version__ = "0.16" __status__ = "testing" __description__ = """OCR base plugin""" @@ -45,7 +45,10 @@ class OCR(Plugin): def _log(self, level, plugintype, pluginname, messages): - return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages) + return self.plugin._log(level, + plugintype, + "%s: %s" % (self.plugin.__name__, self.__name__), + messages) def load_image(self, image): diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 638a1ee1f..84dd5bdd4 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.16" + __version__ = "0.17" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -167,7 +167,7 @@ class Plugin(object): 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 messages if a)) - log("%(plugintype)s %(pluginname)s%(id)s : %(msg)s" + log("%(plugintype)s %(pluginname)s%(id)s: %(msg)s" % {'plugintype': plugintype.upper(), 'pluginname': pluginname, 'id' : ("[%s]" % self.pyfile.id) if hasattr(self, 'pyfile') else "", |