From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hooks/Captcha9kw.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index c86f92972..28bce3d2b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay, RaNaN, zoidberg """ from __future__ import with_statement @@ -31,7 +29,8 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __version__ = "0.09" - __description__ = """Send captchas to 9kw.eu""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), ("https", "bool", "Enable HTTPS", False), @@ -43,11 +42,14 @@ class Captcha9kw(Hook): False), ("timeout", "int", "Timeout (max. 300)", 300), ("passkey", "password", "API key", "")] + + __description__ = """Send captchas to 9kw.eu""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" API_URL = "://www.9kw.eu/index.cgi" + def setup(self): self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL self.info = {} -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hooks/Captcha9kw.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 28bce3d2b..b4e3ad34b 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -60,7 +60,7 @@ class Captcha9kw(Hook): if response.isdigit(): self.logInfo(_("%s credits left") % response) - self.info["credits"] = credits = int(response) + self.info['credits'] = credits = int(response) return credits else: self.logError(response) @@ -106,7 +106,7 @@ class Captcha9kw(Hook): time.sleep(3) result = response2 - task.data["ticket"] = response + task.data['ticket'] = response self.logInfo("result %s : %s" % (response, result)) task.setResult(result) else: @@ -142,7 +142,7 @@ class Captcha9kw(Hook): "correct": "1", "pyload": "1", "source": "pyload", - "id": task.data["ticket"]}) + "id": task.data['ticket']}) self.logInfo("Request correct: %s" % response) except BadHeader, e: @@ -161,7 +161,7 @@ class Captcha9kw(Hook): "correct": "2", "pyload": "1", "source": "pyload", - "id": task.data["ticket"]}) + "id": task.data['ticket']}) self.logInfo("Request refund: %s" % response) except BadHeader, e: -- 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/hooks/Captcha9kw.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'module/plugins/hooks/Captcha9kw.py') diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index b4e3ad34b..1b7406edd 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -1,35 +1,21 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from __future__ import with_statement -from thread import start_new_thread -from base64 import b64encode import time -from module.network.RequestFactory import getURL -from module.network.HTTPRequest import BadHeader +from base64 import b64encode +from thread import start_new_thread +from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getURL from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" - __version__ = "0.09" __type__ = "hook" + __version__ = "0.09" __config__ = [("activated", "bool", "Activated", False), ("force", "bool", "Force CT even if client is connected", True), -- cgit v1.2.3