From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- 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 829e54a46..b188a34d9 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- 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 b188a34d9..509febde6 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -43,7 +43,7 @@ class RPNetBiz(Account): def getAccountStatus(self, user, req): # Using the rpnet API, check if valid premium account - res = req.load("https://premium.rpnet.biz/client_api.php", + res = self.load("https://premium.rpnet.biz/client_api.php", get={"username": user, "password": self.getAccountData(user)['password'], "action": "showAccountInformation"}) self.logDebug("JSON data: %s" % res) -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/accounts/RPNetBiz.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 509febde6..be456f2d7 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -15,11 +15,11 @@ class RPNetBiz(Account): def loadAccountInfo(self, user, req): - # Get account information from rpnet.biz + #: Get account information from rpnet.biz res = self.getAccountStatus(user, req) try: if res['accountInfo']['isPremium']: - # Parse account info. Change the trafficleft later to support per host info. + #: Parse account info. Change the trafficleft later to support per host info. account_info = {"validuntil": float(res['accountInfo']['premiumExpiry']), "trafficleft": -1, "premium": True} else: @@ -33,16 +33,16 @@ class RPNetBiz(Account): def login(self, user, data, req): - # Get account information from rpnet.biz + #: Get account information from rpnet.biz res = self.getAccountStatus(user, req) - # If we have an error in the res, we have wrong login information + #: 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 + #: Using the rpnet API, check if valid premium account res = self.load("https://premium.rpnet.biz/client_api.php", get={"username": user, "password": self.getAccountData(user)['password'], "action": "showAccountInformation"}) -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- 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 be456f2d7..d103e918d 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -7,16 +7,16 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.13" + __version__ = "0.14" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" __authors__ = [("Dman", "dmanugm@gmail.com")] - def loadAccountInfo(self, user, req): + def load_account_info(self, user, req): #: Get account information from rpnet.biz - res = self.getAccountStatus(user, req) + res = self.get_account_status(user, req) try: if res['accountInfo']['isPremium']: #: Parse account info. Change the trafficleft later to support per host info. @@ -26,7 +26,7 @@ class RPNetBiz(Account): account_info = {"validuntil": None, "trafficleft": None, "premium": False} except KeyError: - #handle wrong password exception + # handle wrong password exception account_info = {"validuntil": None, "trafficleft": None, "premium": False} return account_info @@ -34,18 +34,18 @@ class RPNetBiz(Account): def login(self, user, data, req): #: Get account information from rpnet.biz - res = self.getAccountStatus(user, req) + res = self.get_account_status(user, req) #: If we have an error in the res, we have wrong login information if 'error' in res: - self.wrongPassword() + self.wrong_password() - def getAccountStatus(self, user, req): + def get_account_status(self, user, req): #: Using the rpnet API, check if valid premium account res = self.load("https://premium.rpnet.biz/client_api.php", - get={"username": user, "password": self.getAccountData(user)['password'], + get={"username": user, "password": self.get_account_data(user)['password'], "action": "showAccountInformation"}) - self.logDebug("JSON data: %s" % res) + self.log_debug("JSON data: %s" % res) return json_loads(res) -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- 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 d103e918d..db5dbbb24 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -26,7 +26,7 @@ class RPNetBiz(Account): account_info = {"validuntil": None, "trafficleft": None, "premium": False} except KeyError: - # handle wrong password exception + #: Handle wrong password exception account_info = {"validuntil": None, "trafficleft": None, "premium": False} return account_info -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/accounts/RPNetBiz.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index db5dbbb24..66557cbc8 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -20,14 +20,14 @@ class RPNetBiz(Account): try: if res['accountInfo']['isPremium']: #: Parse account info. Change the trafficleft later to support per host info. - account_info = {"validuntil": float(res['accountInfo']['premiumExpiry']), - "trafficleft": -1, "premium": True} + account_info = {'validuntil': float(res['accountInfo']['premiumExpiry']), + 'trafficleft': -1, 'premium': True} else: - account_info = {"validuntil": None, "trafficleft": None, "premium": False} + account_info = {'validuntil': None, 'trafficleft': None, 'premium': False} except KeyError: #: Handle wrong password exception - account_info = {"validuntil": None, "trafficleft": None, "premium": False} + account_info = {'validuntil': None, 'trafficleft': None, 'premium': False} return account_info @@ -44,8 +44,8 @@ class RPNetBiz(Account): def get_account_status(self, user, req): #: Using the rpnet API, check if valid premium account res = self.load("https://premium.rpnet.biz/client_api.php", - get={"username": user, "password": self.get_account_data(user)['password'], - "action": "showAccountInformation"}) + get={'username': user, 'password': self.get_account_data(user)['password'], + 'action': "showAccountInformation"}) self.log_debug("JSON data: %s" % res) return json_loads(res) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- 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 66557cbc8..f48d04f9c 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -8,6 +8,7 @@ class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" __version__ = "0.14" + __status__ = "stable" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- 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 f48d04f9c..c746d75a4 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -8,7 +8,7 @@ class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" __version__ = "0.14" - __status__ = "stable" + __status__ = "testing" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- 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 c746d75a4..cd1523a92 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -15,7 +15,7 @@ class RPNetBiz(Account): __authors__ = [("Dman", "dmanugm@gmail.com")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): #: Get account information from rpnet.biz res = self.get_account_status(user, req) try: @@ -33,19 +33,19 @@ class RPNetBiz(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): #: Get account information from rpnet.biz res = self.get_account_status(user, req) #: If we have an error in the res, we have wrong login information if 'error' in res: - self.wrong_password() + self.fail() def get_account_status(self, user, req): #: Using the rpnet API, check if valid premium account res = self.load("https://premium.rpnet.biz/client_api.php", - get={'username': user, 'password': self.get_account_data(user)['password'], + get={'username': user, 'password': self.get_data(user)['password'], 'action': "showAccountInformation"}) self.log_debug("JSON data: %s" % res) -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/accounts/RPNetBiz.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index cd1523a92..5fd7e5878 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -17,7 +17,7 @@ class RPNetBiz(Account): def parse_info(self, user, password, data, req): #: Get account information from rpnet.biz - res = self.get_account_status(user, req) + res = self.get_account_status(user, password, req) try: if res['accountInfo']['isPremium']: #: Parse account info. Change the trafficleft later to support per host info. @@ -35,17 +35,17 @@ class RPNetBiz(Account): def login(self, user, password, data, req): #: Get account information from rpnet.biz - res = self.get_account_status(user, req) + res = self.get_account_status(user, password, req) #: If we have an error in the res, we have wrong login information if 'error' in res: - self.fail() + self.login_fail() - def get_account_status(self, user, req): + def get_account_status(self, user, password req): #: Using the rpnet API, check if valid premium account res = self.load("https://premium.rpnet.biz/client_api.php", - get={'username': user, 'password': self.get_data(user)['password'], + get={'username': user, 'password': password, 'action': "showAccountInformation"}) self.log_debug("JSON data: %s" % res) -- cgit v1.2.3 From 5745baca2dd9c8831631489781ef950af5184081 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 22:06:31 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1520 --- 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 5fd7e5878..d713cedca 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.14" + __version__ = "0.15" __status__ = "testing" __description__ = """RPNet.biz account plugin""" @@ -42,7 +42,7 @@ class RPNetBiz(Account): self.login_fail() - def get_account_status(self, user, password req): + def get_account_status(self, user, password, req): #: Using the rpnet API, check if valid premium account res = self.load("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': password, -- cgit v1.2.3