From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/crypter/CzshareComFolder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index d1ba8335c..c3606fdab 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -22,7 +22,8 @@ class CzshareComFolder(Crypter): new_links = [] found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: self.fail("Parse error (FOLDER)") + if not found: + self.fail("Parse error (FOLDER)") new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) if new_links: -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/CzshareComFolder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index c3606fdab..c60d5a87d 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -6,9 +6,11 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" + __version__ = "0.2" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' - __version__ = "0.2" + __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -17,6 +19,7 @@ class CzshareComFolder(Crypter): LINK_PATTERN = r'info' #NEXT_PAGE_PATTERN = r'' + def decrypt(self, pyfile): html = self.load(pyfile.url) -- cgit v1.2.3 From a1e78f33dc2b0b6777fdcbc415673f3965b25542 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 16 Jul 2014 00:46:26 +0200 Subject: Prefer self.urls and self.packages for adding links --- module/plugins/crypter/CzshareComFolder.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index c60d5a87d..e0c311ba8 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -17,19 +17,15 @@ class CzshareComFolder(Crypter): FOLDER_PATTERN = r'\s*\s*(.*?)
' LINK_PATTERN = r'info' - #NEXT_PAGE_PATTERN = r'' def decrypt(self, pyfile): html = self.load(pyfile.url) - new_links = [] found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) if not found: self.fail("Parse error (FOLDER)") - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) + if not self.urls: self.fail('Could not extract any links') -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/crypter/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index e0c311ba8..76762b69b 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -23,7 +23,7 @@ class CzshareComFolder(Crypter): html = self.load(pyfile.url) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if not found: + if found is None: self.fail("Parse error (FOLDER)") self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/crypter/CzshareComFolder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 76762b69b..b305575a2 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -22,10 +22,10 @@ class CzshareComFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: self.fail("Parse error (FOLDER)") - self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) + self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) if not self.urls: self.fail('Could not extract any links') -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/crypter/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index b305575a2..64affc867 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -6,8 +6,8 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" - __version__ = "0.2" __type__ = "crypter" + __version__ = "0.2" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/crypter/CzshareComFolder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 64affc867..3762cbf10 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -12,8 +12,8 @@ class CzshareComFolder(Crypter): __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FOLDER_PATTERN = r'\s*\s*(.*?)
' LINK_PATTERN = r'info' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/crypter/CzshareComFolder.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 3762cbf10..9a3881617 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -12,6 +12,7 @@ class CzshareComFolder(Crypter): __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 9a3881617..2b4d736b7 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -23,7 +23,7 @@ class CzshareComFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: self.fail("Parse error (FOLDER)") -- cgit v1.2.3 From e3f5280529921100f48bb8a79853bf480c7611e4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 02:53:05 +0200 Subject: Replace single quotes with doubles in self.error and self.fail msg --- module/plugins/crypter/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 2b4d736b7..8cca84e42 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -29,4 +29,4 @@ class CzshareComFolder(Crypter): self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) if not self.urls: - self.fail('Could not extract any links') + self.fail("Could not extract any links") -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/crypter/CzshareComFolder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 8cca84e42..002d9a9c3 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -25,8 +25,8 @@ class CzshareComFolder(Crypter): m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: - self.fail("Parse error (FOLDER)") + 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") + self.fail(_("Could not extract any links")) -- cgit v1.2.3 From aa0751bcfd995e308bcd586a6965c75e68b1274b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Oct 2014 23:05:13 +0100 Subject: Code cosmetics --- module/plugins/crypter/CzshareComFolder.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') 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")) -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/crypter/CzshareComFolder.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index f88693eb0..53e9e7c36 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -10,6 +10,8 @@ class CzshareComFolder(Crypter): __version__ = "0.2" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz""" __license__ = "GPLv3" -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/crypter/CzshareComFolder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 53e9e7c36..669f469b2 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -5,8 +5,8 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): - __name__ = "CzshareComFolder" - __type__ = "crypter" + __name__ = "CzshareComFolder" + __type__ = "crypter" __version__ = "0.2" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' @@ -14,8 +14,8 @@ class CzshareComFolder(Crypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] FOLDER_PATTERN = r'\s*\s*(.*?)
' -- cgit v1.2.3 From 6151e81fa0b325dffda3da4228d5821e73db3ef3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 01:19:46 +0100 Subject: Fix __version__ format in some plugins --- module/plugins/crypter/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 669f469b2..67376c6e6 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" __type__ = "crypter" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), -- cgit v1.2.3 From 717faa6d2f2a0017b81516a9d01656487f03be28 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:56:01 +0100 Subject: More plugin __pattern__ improved (crypter ones this time) --- module/plugins/crypter/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 67376c6e6..5623a4093 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -9,7 +9,7 @@ class CzshareComFolder(Crypter): __type__ = "crypter" __version__ = "0.20" - __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' + __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] -- cgit v1.2.3