diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-27 23:05:13 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-27 23:05:13 +0100 |
commit | aa0751bcfd995e308bcd586a6965c75e68b1274b (patch) | |
tree | 8eba27735d57ca5b7137588efe219f845734de17 /module/plugins | |
parent | [Api] Fix addPackage folder generator (diff) | |
download | pyload-aa0751bcfd995e308bcd586a6965c75e68b1274b.tar.xz |
Code cosmetics
Diffstat (limited to 'module/plugins')
26 files changed, 71 insertions, 97 deletions
diff --git a/module/plugins/Container.py b/module/plugins/Container.py index 1d93a4f4a..0e8b20a86 100644 --- a/module/plugins/Container.py +++ b/module/plugins/Container.py @@ -10,15 +10,16 @@ from module.utils import save_join class Container(Crypter): - __name__ = "Container" - __type__ = "container" + __name__ = "Container" + __type__ = "container" __version__ = "0.1" __pattern__ = None + __config__ = [] #: [("name", "type", "desc", "default")] __description__ = """Base container decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de")] + __license__ = "GPLv3" + __authors__ = [("mkaay", "mkaay@mkaay.de")] def preprocessing(self, thread): diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index 5710aae84..ede084c3a 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -24,17 +24,16 @@ class Hook(Base): """ Base class for hook plugins. """ - __name__ = "Hook" - __type__ = "hook" + __name__ = "Hook" + __type__ = "hook" __version__ = "0.2" - __threaded__ = [] - __config__ = [("name", "type", "desc", "default")] + __config__ = [] #: [("name", "type", "desc", "default")] __description__ = """Interface for hook""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de"), - ("RaNaN", "RaNaN@pyload.org")] + __license__ = "GPLv3" + __authors__ = [("mkaay", "mkaay@mkaay.de"), + ("RaNaN", "RaNaN@pyload.org")] #: automatically register event listeners for functions, attribute will be deleted dont use it yourself diff --git a/module/plugins/Hoster.py b/module/plugins/Hoster.py index 535d7e3f2..0768391e5 100644 --- a/module/plugins/Hoster.py +++ b/module/plugins/Hoster.py @@ -9,12 +9,13 @@ def getInfo(self): class Hoster(Plugin): - __name__ = "Hoster" - __type__ = "hoster" + __name__ = "Hoster" + __type__ = "hoster" __version__ = "0.1" __pattern__ = None + __config__ = [] #: [("name", "type", "desc", "default")] __description__ = """Base hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("mkaay", "mkaay@mkaay.de")] + __license__ = "GPLv3" + __authors__ = [("mkaay", "mkaay@mkaay.de")] diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index 47f48c031..5348c070e 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -15,14 +15,14 @@ from module.ConfigParser import IGNORE class PluginManager: - ROOT = "module.plugins." + ROOT = "module.plugins." USERROOT = "userplugins." - TYPES = ("crypter", "container", "hoster", "captcha", "accounts", "hooks", "internal") + TYPES = ("crypter", "container", "hoster", "captcha", "accounts", "hooks", "internal") - PATTERN = re.compile(r'__pattern__.*=.*r("|\')([^"\']+)') - VERSION = re.compile(r'__version__.*=.*("|\')([\d.]+)') - CONFIG = re.compile(r'__config__.*=.*\[([^\]]+)', re.M) - DESC = re.compile(r'__description__.?=.?("|"""|\')([^"\']+)') + PATTERN = re.compile(r'__pattern__\s*=\s*[a-z]*("|\')([^"\']+)') + VERSION = re.compile(r'__version__\s*=\s*("|\')([\d.]+)') + CONFIG = re.compile(r'__config__\s*=\s*\[([^\]]+)', re.M) + DESC = re.compile(r'__description__\s*=\s*("|"""|\')([^"\']+)') def __init__(self, core): diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 002d9a9c3..f88693eb0 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -28,5 +28,3 @@ class CzshareComFolder(Crypter): self.error(_("FOLDER_PATTERN not found")) self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) - if not self.urls: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py index 8cea48062..525e201ce 100644 --- a/module/plugins/crypter/DataHuFolder.py +++ b/module/plugins/crypter/DataHuFolder.py @@ -41,5 +41,3 @@ class DataHuFolder(SimpleCrypter): if package_links: self.packages = [(package_name, package_links, folder_name)] - else: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index b968bb86d..ea29891b9 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -45,9 +45,6 @@ class EmbeduploadCom(Crypter): tmp_links.extend([x[1] for x in m if x[0] not in ignored_set]) self.urls = self.getLocation(tmp_links) - if not self.urls: - self.fail(_("Could not extract any links")) - def getLocation(self, tmp_links): new_links = [] diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py index 826350f6c..d30ccb6c1 100644 --- a/module/plugins/crypter/FileserveComFolder.py +++ b/module/plugins/crypter/FileserveComFolder.py @@ -34,5 +34,3 @@ class FileserveComFolder(Crypter): if new_links: self.urls = [map(lambda s: "http://fileserve.com%s" % s, new_links)] - else: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py index 3a31903ae..ba40ded99 100644 --- a/module/plugins/crypter/LetitbitNetFolder.py +++ b/module/plugins/crypter/LetitbitNetFolder.py @@ -29,6 +29,3 @@ class LetitbitNetFolder(Crypter): self.error(_("FOLDER_PATTERN not found")) self.urls.extend(re.findall(self.LINK_PATTERN, folder.group(0))) - - if not self.urls: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index aa340f873..644245e25 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -73,8 +73,6 @@ class LinkSaveIn(SimpleCrypter): # Pack if package_links: self.packages = [(package_name, package_links, folder_name)] - else: - self.fail(_("Could not extract any links")) def isOnline(self): diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 0848338ec..7cedf4d91 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -28,8 +28,6 @@ class LinkdecrypterCom(Crypter): # API not working anymore self.urls = self.decryptHTML() - if not self.urls: - self.fail(_("Could not extract any links")) def decryptAPI(self): diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py index ae8f3fd44..69bfe4092 100644 --- a/module/plugins/crypter/MediafireComFolder.py +++ b/module/plugins/crypter/MediafireComFolder.py @@ -52,6 +52,3 @@ class MediafireComFolder(Crypter): self.offline() else: self.urls.append(url) - - if not self.urls: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index e894c8c5d..5ee17225b 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -38,6 +38,3 @@ class MultiloadCz(Crypter): if not self.urls: ignored_set = set(self.getConfig("ignoredHoster").split('|')) self.urls.extend([x[1] for x in m if x[0] not in ignored_set]) - - if not self.urls: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 801afc50b..7d82cba7a 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -73,9 +73,8 @@ class NCryptIn(Crypter): package_links = set(package_links) # Pack and return links - if not package_links: - self.fail(_("Could not extract any links")) - self.packages = [(package_name, package_links, folder_name)] + if package_links: + self.packages = [(package_name, package_links, folder_name)] def isSingleLink(self): diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py index 7b2d336b3..d9048655e 100644 --- a/module/plugins/crypter/QuickshareCzFolder.py +++ b/module/plugins/crypter/QuickshareCzFolder.py @@ -27,6 +27,3 @@ class QuickshareCzFolder(Crypter): if m is None: self.error(_("FOLDER_PATTERN not found")) self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) - - if not self.urls: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index a71c736b5..135268dcc 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -93,8 +93,6 @@ class RelinkUs(Crypter): # Pack if package_links: self.packages = [(package_name, package_links, folder_name)] - else: - self.fail(_("Could not extract any links")) def initPackage(self, pyfile): diff --git a/module/plugins/crypter/SexuriaCom.py b/module/plugins/crypter/SexuriaCom.py index 6b9b2c5f6..20559e9d7 100644 --- a/module/plugins/crypter/SexuriaCom.py +++ b/module/plugins/crypter/SexuriaCom.py @@ -86,10 +86,6 @@ class SexuriaCom(Crypter): else: linklist.append(finallink) - # Inform the user if no link could been extracted - if linklist == []: - self.error(_("Could not extract any links")) - # Debug log self.logDebug("%d supported links" % len(linklist)) for i, link in enumerate(linklist): diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index acb360ee4..feaec2e8d 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -42,5 +42,3 @@ class UlozToFolder(Crypter): if new_links: self.urls = [map(lambda s: "http://ulozto.net/%s" % s, new_links)] - else: - self.fail(_("Could not extract any links")) diff --git a/module/plugins/internal/DeadCrypter.py b/module/plugins/internal/DeadCrypter.py index 760ed61b1..9267f4c2e 100644 --- a/module/plugins/internal/DeadCrypter.py +++ b/module/plugins/internal/DeadCrypter.py @@ -4,15 +4,16 @@ from module.plugins.Crypter import Crypter as _Crypter class DeadCrypter(_Crypter): - __name__ = "DeadCrypter" - __type__ = "crypter" + __name__ = "DeadCrypter" + __type__ = "crypter" __version__ = "0.02" __pattern__ = None + __config__ = [] __description__ = """ Crypter is no longer available """ - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] def setup(self): diff --git a/module/plugins/internal/DeadHoster.py b/module/plugins/internal/DeadHoster.py index 2f0a01732..6633a8f1c 100644 --- a/module/plugins/internal/DeadHoster.py +++ b/module/plugins/internal/DeadHoster.py @@ -12,15 +12,16 @@ def create_getInfo(plugin): class DeadHoster(_Hoster): - __name__ = "DeadHoster" - __type__ = "hoster" + __name__ = "DeadHoster" + __type__ = "hoster" __version__ = "0.12" __pattern__ = None + __config__ = [] __description__ = """ Hoster is no longer available """ - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def setup(self): diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index 5aadf6f2e..112736b0c 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -7,12 +7,15 @@ from module.utils import remove_chars class MultiHoster(Hook): - __name__ = "AbtractExtractor" + __name__ = "AbtractExtractor" + __type__ = "hook" __version__ = "0.19" + __config__ = [] + __description__ = """Generic MultiHoster plugin""" - __license__ = "GPLv3" - __authors__ = [("pyLoad Team", "admin@pyload.org")] + __license__ = "GPLv3" + __authors__ = [("pyLoad Team", "admin@pyload.org")] replacements = [("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"), diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index f6783cffb..bfa2e6408 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -12,17 +12,18 @@ from module.utils import fixup, html_unescape class SimpleCrypter(Crypter): - __name__ = "SimpleCrypter" - __type__ = "crypter" + __name__ = "SimpleCrypter" + __type__ = "crypter" __version__ = "0.20" __pattern__ = None + __config__ = [] __description__ = """Simple decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it"), + ("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] """ @@ -111,8 +112,6 @@ class SimpleCrypter(Crypter): if self.package_links: self.packages = [(package_name, self.package_links, folder_name)] - else: - self.fail(_("Could not extract any links")) def getLinks(self): diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index ca84dc33e..782655007 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -157,17 +157,18 @@ def timestamp(): class SimpleHoster(Hoster): - __name__ = "SimpleHoster" - __type__ = "hoster" + __name__ = "SimpleHoster" + __type__ = "hoster" __version__ = "0.42" __pattern__ = None + __config__ = [] __description__ = """Simple hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] """ diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py index 69b5cfc22..574bdd920 100644 --- a/module/plugins/internal/XFSPAccount.py +++ b/module/plugins/internal/XFSPAccount.py @@ -10,14 +10,14 @@ from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies class XFSPAccount(Account): - __name__ = "XFSPAccount" - __type__ = "account" + __name__ = "XFSPAccount" + __type__ = "account" __version__ = "0.17" __description__ = """XFileSharingPro account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] """ diff --git a/module/plugins/internal/XFSPCrypter.py b/module/plugins/internal/XFSPCrypter.py index 372657d2d..52b6aed34 100644 --- a/module/plugins/internal/XFSPCrypter.py +++ b/module/plugins/internal/XFSPCrypter.py @@ -4,15 +4,16 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class XFSPCrypter(SimpleCrypter): - __name__ = "XFSPCrypter" - __type__ = "crypter" + __name__ = "XFSPCrypter" + __type__ = "crypter" __version__ = "0.02" __pattern__ = None + __config__ = [] __description__ = """XFileSharingPro decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] HOSTER_NAME = None diff --git a/module/plugins/internal/XFSPHoster.py b/module/plugins/internal/XFSPHoster.py index 44b2006ae..46529eaa8 100644 --- a/module/plugins/internal/XFSPHoster.py +++ b/module/plugins/internal/XFSPHoster.py @@ -15,17 +15,18 @@ from module.utils import html_unescape class XFSPHoster(SimpleHoster): - __name__ = "XFSPHoster" - __type__ = "hoster" + __name__ = "XFSPHoster" + __type__ = "hoster" __version__ = "0.06" __pattern__ = None + __config__ = [] __description__ = """XFileSharingPro hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] HOSTER_NAME = None |