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/RPNetBiz.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 49a294d14..08bedda7d 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -8,10 +8,12 @@ class RPNetBiz(Account): __name__ = "RPNetBiz" __version__ = "0.1" __type__ = "account" + __description__ = """RPNet.biz account plugin""" __author_name__ = "Dman" __author_mail__ = "dmanugm@gmail.com" + def loadAccountInfo(self, user, req): # Get account information from rpnet.biz response = self.getAccountStatus(user, req) -- 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/RPNetBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 08bedda7d..358f6ffca 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -6,8 +6,8 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" - __version__ = "0.1" __type__ = "account" + __version__ = "0.1" __description__ = """RPNet.biz account plugin""" __author_name__ = "Dman" -- 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/RPNetBiz.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 358f6ffca..83ef72bef 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -10,8 +10,7 @@ class RPNetBiz(Account): __version__ = "0.1" __description__ = """RPNet.biz account plugin""" - __author_name__ = "Dman" - __author_mail__ = "dmanugm@gmail.com" + __authors__ = [("Dman", "dmanugm@gmail.com")] 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/RPNetBiz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 83ef72bef..3dcab7d54 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -10,6 +10,7 @@ class RPNetBiz(Account): __version__ = "0.1" __description__ = """RPNet.biz account plugin""" + __license__ = "GPLv3" __authors__ = [("Dman", "dmanugm@gmail.com")] -- 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/RPNetBiz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 3dcab7d54..e4b873824 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -31,6 +31,7 @@ class RPNetBiz(Account): return account_info + def login(self, user, data, req): # Get account information from rpnet.biz response = self.getAccountStatus(user, req) -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/accounts/RPNetBiz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index e4b873824..59349bd7a 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -40,6 +40,7 @@ class RPNetBiz(Account): if 'error' in response: self.wrongPassword() + def getAccountStatus(self, user, req): # Using the rpnet API, check if valid premium account response = req.load("https://premium.rpnet.biz/client_api.php", -- 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/RPNetBiz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 59349bd7a..35ad58d2d 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -5,13 +5,13 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): - __name__ = "RPNetBiz" - __type__ = "account" + __name__ = "RPNetBiz" + __type__ = "account" __version__ = "0.1" __description__ = """RPNet.biz account plugin""" - __license__ = "GPLv3" - __authors__ = [("Dman", "dmanugm@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Dman", "dmanugm@gmail.com")] def loadAccountInfo(self, user, req): -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/accounts/RPNetBiz.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 35ad58d2d..4daa56a75 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -16,11 +16,11 @@ class RPNetBiz(Account): def loadAccountInfo(self, user, req): # Get account information from rpnet.biz - response = self.getAccountStatus(user, req) + res = self.getAccountStatus(user, req) try: - if response['accountInfo']['isPremium']: + if res['accountInfo']['isPremium']: # Parse account info. Change the trafficleft later to support per host info. - account_info = {"validuntil": int(response['accountInfo']['premiumExpiry']), + account_info = {"validuntil": int(res['accountInfo']['premiumExpiry']), "trafficleft": -1, "premium": True} else: account_info = {"validuntil": None, "trafficleft": None, "premium": False} @@ -34,18 +34,18 @@ class RPNetBiz(Account): def login(self, user, data, req): # Get account information from rpnet.biz - response = self.getAccountStatus(user, req) + res = self.getAccountStatus(user, req) - # If we have an error in the response, we have wrong login information - if 'error' in response: + # If we have an error in the res, we have wrong login information + if 'error' in res: self.wrongPassword() def getAccountStatus(self, user, req): # Using the rpnet API, check if valid premium account - response = req.load("https://premium.rpnet.biz/client_api.php", + res = req.load("https://premium.rpnet.biz/client_api.php", get={"username": user, "password": self.accounts[user]['password'], "action": "showAccountInformation"}) - self.logDebug("JSON data: %s" % response) + self.logDebug("JSON data: %s" % res) - return json_loads(response) + return json_loads(res) -- 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/accounts/RPNetBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 4daa56a75..8bd358084 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.1" + __version__ = "0.10" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" -- 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/RPNetBiz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 8bd358084..813453c03 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.10" + __version__ = "0.11" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" @@ -20,7 +20,7 @@ class RPNetBiz(Account): try: if res['accountInfo']['isPremium']: # Parse account info. Change the trafficleft later to support per host info. - account_info = {"validuntil": int(res['accountInfo']['premiumExpiry']), + account_info = {"validuntil": float(res['accountInfo']['premiumExpiry']), "trafficleft": -1, "premium": True} else: account_info = {"validuntil": None, "trafficleft": None, "premium": False} -- cgit v1.2.3