From 5a139055ae658d3a05cbb658cbd66aeae0d01db5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 21:06:10 +0200 Subject: Spare code cosmetics --- module/plugins/accounts/LinksnappyCom.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py index 9d5202945..2b1d1aebf 100644 --- a/module/plugins/accounts/LinksnappyCom.py +++ b/module/plugins/accounts/LinksnappyCom.py @@ -10,6 +10,7 @@ class LinksnappyCom(Account): __name__ = "LinksnappyCom" __type__ = "account" __version__ = "0.06" + __description__ = """Linksnappy.com account plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] @@ -25,7 +26,7 @@ class LinksnappyCom(Account): j = json_loads(r) if j['error']: - return {"premium": False} + return {'premium': False} validuntil = j['return']['expire'] @@ -33,7 +34,7 @@ class LinksnappyCom(Account): validuntil = -1 elif validuntil == 'expired': - return {"premium": False} + return {'premium': False} else: validuntil = float(validuntil) @@ -43,15 +44,17 @@ class LinksnappyCom(Account): else: trafficleft = self.parseTraffic("%d MB" % j['return']['trafficleft']) - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} + return {'premium' : True , + 'validuntil' : validuntil , + 'trafficleft': trafficleft} def login(self, user, data, req): - r = req.load("https://gen.linksnappy.com/lseAPI.php", - get={'act' : 'USERDETAILS', - 'username': user, - 'password': hashlib.md5(data['password']).hexdigest()}, - decode=True) + html = req.load("https://gen.linksnappy.com/lseAPI.php", + get={'act' : 'USERDETAILS', + 'username': user, + 'password': hashlib.md5(data['password']).hexdigest()}, + decode=True) - if 'Invalid Account Details' in r: + if "Invalid Account Details" in html: self.wrongPassword() -- cgit v1.2.3