From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/crypter/GooGl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 15f0a9a8c..343bce5fd 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -27,7 +27,7 @@ class GooGl(Crypter): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - API_URL = 'https://www.googleapis.com/urlshortener/v1/url' + API_URL = "https://www.googleapis.com/urlshortener/v1/url" def decrypt(self, pyfile): rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) -- 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/GooGl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 343bce5fd..37531c11e 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -20,15 +20,18 @@ from module.common.json_layer import json_loads class GooGl(Crypter): __name__ = "GooGl" + __version__ = "0.01" __type__ = "crypter" + __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' - __version__ = "0.01" + __description__ = """Goo.gl decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" API_URL = "https://www.googleapis.com/urlshortener/v1/url" + def decrypt(self, pyfile): rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) self.logDebug('JSON data: ' + rep) -- 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/GooGl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 37531c11e..52bf93ed3 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -38,6 +38,6 @@ class GooGl(Crypter): rep = json_loads(rep) if 'longUrl' in rep: - self.core.files.addLinks([rep['longUrl']], pyfile.package().id) + self.urls = [rep['longUrl']] else: self.fail('Unable to expand shortened link') -- 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/GooGl.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 52bf93ed3..1d9c2801f 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ from module.plugins.Crypter import Crypter from module.common.json_layer import json_loads @@ -20,8 +6,8 @@ from module.common.json_layer import json_loads class GooGl(Crypter): __name__ = "GooGl" - __version__ = "0.01" __type__ = "crypter" + __version__ = "0.01" __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/crypter/GooGl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 1d9c2801f..b4f6c3ea7 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -20,7 +20,7 @@ class GooGl(Crypter): def decrypt(self, pyfile): rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) - self.logDebug('JSON data: ' + rep) + self.logDebug("JSON data: " + rep) rep = json_loads(rep) if 'longUrl' in rep: -- 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/GooGl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index b4f6c3ea7..8b0c2ac91 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -12,8 +12,8 @@ class GooGl(Crypter): __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' __description__ = """Goo.gl decrypter plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] + API_URL = "https://www.googleapis.com/urlshortener/v1/url" -- 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/GooGl.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 8b0c2ac91..29c5a5f5e 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -12,6 +12,7 @@ class GooGl(Crypter): __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' __description__ = """Goo.gl decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] -- 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/GooGl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 29c5a5f5e..4f551aa42 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -27,4 +27,4 @@ class GooGl(Crypter): if 'longUrl' in rep: self.urls = [rep['longUrl']] else: - self.fail('Unable to expand shortened link') + self.fail("Unable to expand shortened link") -- 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/GooGl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 4f551aa42..c831fb2de 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -27,4 +27,4 @@ class GooGl(Crypter): if 'longUrl' in rep: self.urls = [rep['longUrl']] else: - self.fail("Unable to expand shortened link") + self.fail(_("Unable to expand shortened link")) -- 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/GooGl.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index c831fb2de..d9713ddce 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -10,6 +10,8 @@ class GooGl(Crypter): __version__ = "0.01" __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Goo.gl decrypter plugin""" __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/GooGl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index d9713ddce..d548a3375 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -5,8 +5,8 @@ from module.common.json_layer import json_loads class GooGl(Crypter): - __name__ = "GooGl" - __type__ = "crypter" + __name__ = "GooGl" + __type__ = "crypter" __version__ = "0.01" __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' @@ -14,8 +14,8 @@ class GooGl(Crypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Goo.gl decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] API_URL = "https://www.googleapis.com/urlshortener/v1/url" -- cgit v1.2.3