From f5535809bebc6cc343475704832c8fd8674d2d06 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 23 Jul 2013 20:22:42 +0200 Subject: Fixed PEP 8 violations in Accounts --- module/plugins/accounts/YibaishiwuCom.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/YibaishiwuCom.py') diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py index e2aa6f11d..c4eab74dc 100644 --- a/module/plugins/accounts/YibaishiwuCom.py +++ b/module/plugins/accounts/YibaishiwuCom.py @@ -17,9 +17,11 @@ @author: zoidberg """ -from module.plugins.Account import Account import re +from module.plugins.Account import Account + + class YibaishiwuCom(Account): __name__ = "YibaishiwuCom" __version__ = "0.01" @@ -32,20 +34,20 @@ class YibaishiwuCom(Account): def loadAccountInfo(self, user, req): #self.relogin(user) - html = req.load("http://115.com/", decode = True) - + html = req.load("http://115.com/", decode=True) + found = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) premium = True if (found and 'is_vip: 1' in found.group(1)) else False validuntil = trafficleft = (-1 if found else 0) return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}) def login(self, user, data, req): - html = req.load('http://passport.115.com/?ac=login', post = { + html = req.load('http://passport.115.com/?ac=login', post={ "back": "http://www.115.com/", "goto": "http://115.com/", "login[account]": user, "login[passwd]": data['password'] - }, decode = True) + }, decode=True) if not 'var USER_PERMISSION = {' in html: - self.wrongPassword() \ No newline at end of file + self.wrongPassword() -- cgit v1.2.3