From 97d25752691aa561c29a91166fdd30302bef2db2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 00:54:03 +0200 Subject: [Account] parse_info -> grab_info --- 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 d713cedca..5c8c788b8 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 parse_info(self, user, password, data, req): + def grab_info(self, user, password, data, req): #: Get account information from rpnet.biz res = self.get_account_status(user, password, req) try: @@ -39,7 +39,7 @@ class RPNetBiz(Account): #: If we have an error in the res, we have wrong login information if 'error' in res: - self.login_fail() + self.fail_login() def get_account_status(self, user, password, req): -- cgit v1.2.3 From fb45ec44220201268f99b747831df717fa7a83f8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 16:31:48 +0200 Subject: [Account] Fix __version__ --- 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 5c8c788b8..f973ea4cd 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.15" + __version__ = "0.16" __status__ = "testing" __description__ = """RPNet.biz account plugin""" -- cgit v1.2.3 From ec6e5dc7fcdcefee10e37d22473c9accae1104cf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 29 Sep 2015 20:05:07 +0200 Subject: Account class completely rewritten + plugins updated --- module/plugins/accounts/RPNetBiz.py | 27 +++++++++++++++++++++------ 1 file changed, 21 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 f973ea4cd..2d2a7fba0 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.16" + __version__ = "0.17" __status__ = "testing" __description__ = """RPNet.biz account plugin""" @@ -15,9 +15,24 @@ class RPNetBiz(Account): __authors__ = [("Dman", "dmanugm@gmail.com")] - def grab_info(self, user, password, data, req): + def grab_hosters(self, user, password, data): + res = self.load("https://premium.rpnet.biz/client_api.php", + get={'username': user, + 'password': password, + 'action' : "showHosterList"}) + hoster_list = json_loads(res) + + #: If account is not valid thera are no hosters available + if 'error' in hoster_list: + return [] + + #: Extract hosters from json file + return hoster_list['hosters'] + + + def grab_info(self, user, password, data): #: Get account information from rpnet.biz - res = self.get_account_status(user, password, req) + res = self.get_account_status(user, password) try: if res['accountInfo']['isPremium']: #: Parse account info. Change the trafficleft later to support per host info. @@ -33,16 +48,16 @@ class RPNetBiz(Account): return account_info - def login(self, user, password, data, req): + def signin(self, user, password, data): #: Get account information from rpnet.biz - res = self.get_account_status(user, password, req) + res = self.get_account_status(user, password) #: If we have an error in the res, we have wrong login information if 'error' in res: self.fail_login() - def get_account_status(self, user, password, req): + def get_account_status(self, user, password): #: 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 From 3b3a4bd889286777ba6a590a1f74cf3edae36a72 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 30 Sep 2015 00:30:53 +0200 Subject: Add __config__ to MultiAccount (and XFSAccount) based plugins --- module/plugins/accounts/RPNetBiz.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/plugins/accounts/RPNetBiz.py') diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 2d2a7fba0..3b814debc 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -10,6 +10,10 @@ class RPNetBiz(Account): __version__ = "0.17" __status__ = "testing" + __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to use" , "all"), + ("mh_list" , "str" , "Hoster list (comma separated)", "" ), + ("mh_interval", "int" , "Reload interval in minutes" , 60 )] + __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" __authors__ = [("Dman", "dmanugm@gmail.com")] -- cgit v1.2.3