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/accounts/FastixRu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index dbfd1f33e..6aec55a84 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -14,7 +14,7 @@ class FastixRu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data["api"])) + page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api'])) page = json_loads(page) points = page['points'] kb = float(points) @@ -26,9 +26,9 @@ class FastixRu(Account): return account_info def login(self, user, data, req): - page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data["password"])) + page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password'])) api = json_loads(page) api = api['apikey'] - data["api"] = api + data['api'] = api if "error_code" in page: self.wrongPassword() -- 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/accounts/FastixRu.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 6aec55a84..9e8d1f4fe 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -8,10 +8,12 @@ class FastixRu(Account): __name__ = "FastixRu" __version__ = "0.02" __type__ = "account" + __description__ = """Fastix account plugin""" __author_name__ = "Massimo Rosamilia" __author_mail__ = "max@spiritix.eu" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api'])) -- 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/accounts/FastixRu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 9e8d1f4fe..7e46ccd05 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -6,8 +6,8 @@ from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" __description__ = """Fastix account plugin""" __author_name__ = "Massimo Rosamilia" -- 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/accounts/FastixRu.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 7e46ccd05..c69f73735 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -10,8 +10,7 @@ class FastixRu(Account): __version__ = "0.02" __description__ = """Fastix account plugin""" - __author_name__ = "Massimo Rosamilia" - __author_mail__ = "max@spiritix.eu" + __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] def loadAccountInfo(self, user, req): -- 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/accounts/FastixRu.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index c69f73735..10328b840 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -10,6 +10,7 @@ class FastixRu(Account): __version__ = "0.02" __description__ = """Fastix account plugin""" + __license__ = "GPLv3" __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] -- cgit v1.2.3 From 6a0fb7fdd4ea2749be44625225d8a235a78f032f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:42:39 +0200 Subject: [accounts] Code cosmetics --- module/plugins/accounts/FastixRu.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 10328b840..8ced61f15 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -27,6 +27,7 @@ class FastixRu(Account): account_info = {"validuntil": None, "trafficleft": None, "premium": False} return account_info + def login(self, user, data, req): page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password'])) api = json_loads(page) -- 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/accounts/FastixRu.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 8ced61f15..049ee9f77 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -5,13 +5,13 @@ from module.common.json_layer import json_loads class FastixRu(Account): - __name__ = "FastixRu" - __type__ = "account" + __name__ = "FastixRu" + __type__ = "account" __version__ = "0.02" __description__ = """Fastix account plugin""" - __license__ = "GPLv3" - __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] + __license__ = "GPLv3" + __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] def loadAccountInfo(self, user, req): -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/accounts/FastixRu.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 049ee9f77..ced49125a 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -16,11 +16,11 @@ class FastixRu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api'])) - page = json_loads(page) + page = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) + points = page['points'] - kb = float(points) - kb = kb * 1024 ** 2 / 1000 + kb = float(points) * 1024 ** 2 / 1000 + if points > 0: account_info = {"validuntil": -1, "trafficleft": kb} else: @@ -29,7 +29,8 @@ class FastixRu(Account): def login(self, user, data, req): - page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password'])) + page = req.load("http://fastix.ru/api_v2/", + get={'sub': "get_apikey", 'email': user, 'password': data['password']}) api = json_loads(page) api = api['apikey'] data['api'] = api -- cgit v1.2.3 From fb65d5354c3cc80c3f48c3a2745b8dc01105edfd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:02:29 +0100 Subject: Update account plugins --- module/plugins/accounts/FastixRu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index ced49125a..d33d611c9 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -16,9 +16,9 @@ class FastixRu(Account): def loadAccountInfo(self, user, req): data = self.getAccountData(user) - page = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) + html = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"})) - points = page['points'] + points = html['points'] kb = float(points) * 1024 ** 2 / 1000 if points > 0: @@ -29,10 +29,10 @@ class FastixRu(Account): def login(self, user, data, req): - page = req.load("http://fastix.ru/api_v2/", + html = req.load("http://fastix.ru/api_v2/", get={'sub': "get_apikey", 'email': user, 'password': data['password']}) - api = json_loads(page) + api = json_loads(html) api = api['apikey'] data['api'] = api - if "error_code" in page: + if "error_code" in html: self.wrongPassword() -- cgit v1.2.3