From 5deded62d94c04be64d34f6b67d07803eea9b6bf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Dec 2015 18:43:15 +0100 Subject: Spare code cosmetics --- module/plugins/accounts/FastixRu.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'module/plugins/accounts/FastixRu.py') diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py index 33f7eeae9..d28cc830b 100644 --- a/module/plugins/accounts/FastixRu.py +++ b/module/plugins/accounts/FastixRu.py @@ -21,19 +21,20 @@ class FastixRu(MultiAccount): def grab_hosters(self, user, password, data): html = self.load("http://fastix.ru/api_v2", - get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", - 'sub' : "allowed_sources"}) + get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", + 'sub' : "allowed_sources"}) host_list = json.loads(html) host_list = host_list['allow'] return host_list def grab_info(self, user, password, data): - html = json.loads(self.load("http://fastix.ru/api_v2/", - get={'apikey': data['apikey'], - 'sub' : "getaccountdetails"})) + html = self.load("http://fastix.ru/api_v2/", + get={'apikey': data['apikey'], + 'sub' : "getaccountdetails"}) + json_data = json.loads(html) - points = html['points'] + points = json_data['points'] kb = float(points) * 1024 ** 2 / 1000 if points > 0: @@ -44,10 +45,11 @@ class FastixRu(MultiAccount): def signin(self, user, password, data): - api = json.loads(self.load("https://fastix.ru/api_v2/", - get={'sub' : "get_apikey", - 'email' : user, - 'password': password})) + html = self.load("https://fastix.ru/api_v2/", + get={'sub' : "get_apikey", + 'email' : user, + 'password': password}) + api = json.loads(html) if 'error' in api: self.fail_login(api['error_txt']) -- cgit v1.2.3