diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-23 20:22:42 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-23 20:22:42 +0200 |
commit | f5535809bebc6cc343475704832c8fd8674d2d06 (patch) | |
tree | c59bc1e6d71c04f5545ea262056c0c5be1bd8910 /module/plugins/accounts/ZeveraCom.py | |
parent | Fixed PEP 8 violations in Hosters (diff) | |
download | pyload-f5535809bebc6cc343475704832c8fd8674d2d06.tar.xz |
Fixed PEP 8 violations in Accounts
Diffstat (limited to 'module/plugins/accounts/ZeveraCom.py')
-rw-r--r-- | module/plugins/accounts/ZeveraCom.py | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index 61a66cd89..13ed95133 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- +from time import mktime, strptime + from module.plugins.Account import Account -import re -from time import mktime, strptime class ZeveraCom(Account): __name__ = "ZeveraCom" @@ -10,17 +10,17 @@ class ZeveraCom(Account): __type__ = "account" __description__ = """Zevera.com account plugin""" __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") - - def loadAccountInfo(self, user, req): + __author_mail__ = ("zoidberg@mujmail.cz") + + def loadAccountInfo(self, user, req): data = self.getAPIData(req) if data == "No traffic": account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} else: account_info = { "trafficleft": int(data['availabletodaytraffic']) * 1024, - "validuntil": mktime(strptime(data['endsubscriptiondate'],"%Y/%m/%d %H:%M:%S")), - "premium": True + "validuntil": mktime(strptime(data['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")), + "premium": True } return account_info @@ -29,8 +29,8 @@ class ZeveraCom(Account): self.password = data["password"] if self.getAPIData(req) == "No traffic": self.wrongPassword() - - def getAPIData(self, req, just_header = False, **kwargs): + + def getAPIData(self, req, just_header=False, **kwargs): get_data = { 'cmd': 'accountinfo', 'login': self.loginname, @@ -38,12 +38,14 @@ class ZeveraCom(Account): } get_data.update(kwargs) - response = req.load("http://www.zevera.com/jDownloader.ashx", get = get_data, decode = True, just_header = just_header) + response = req.load("http://www.zevera.com/jDownloader.ashx", get=get_data, + decode=True, just_header=just_header) self.logDebug(response) if ':' in response: if not just_header: - response = response.replace(',','\n') - return dict((y.strip().lower(), z.strip()) for (y,z) in [x.split(':',1) for x in response.splitlines() if ':' in x]) + response = response.replace(',', '\n') + return dict((y.strip().lower(), z.strip()) for (y, z) in + [x.split(':', 1) for x in response.splitlines() if ':' in x]) else: - return response
\ No newline at end of file + return response |