summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/Account.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-11 17:08:29 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-11 17:08:29 +0100
commit1de45d9f4f2a39e205dd99e0dcf8b0c323537fea (patch)
treeb83d12fd13a27d798326d8a5e2fda136cab009e4 /pyload/plugins/Account.py
parentBucket and CookieJar from 0.5.0 (diff)
downloadpyload-1de45d9f4f2a39e205dd99e0dcf8b0c323537fea.tar.xz
Spare code cosmetics
Diffstat (limited to 'pyload/plugins/Account.py')
-rw-r--r--pyload/plugins/Account.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/pyload/plugins/Account.py b/pyload/plugins/Account.py
index 79502df3a..1444a4300 100644
--- a/pyload/plugins/Account.py
+++ b/pyload/plugins/Account.py
@@ -188,16 +188,16 @@ class Account(Base):
:param req: `Request` instance
:return:
"""
- return {"validuntil": None, #: -1 for unlimited
- "login": name,
- # "password": self.accounts[name]['password'], #: commented due security reason
- "options": self.accounts[name]['options'],
- "valid": self.accounts[name]['valid'],
- "trafficleft": None, #: in kb, -1 for unlimited
- "maxtraffic": None,
- "premium": None,
- "timestamp": 0, #: time this info was retrieved
- "type": self.__name}
+ return {"validuntil" : None, #: -1 for unlimited
+ "login" : name,
+ # "password" : self.accounts[name]['password'], #: commented due security reason
+ "options" : self.accounts[name]['options'],
+ "valid" : self.accounts[name]['valid'],
+ "trafficleft": None, #: in bytes, -1 for unlimited
+ "maxtraffic" : None,
+ "premium" : None,
+ "timestamp" : 0, #: time this info was retrieved
+ "type" : self.__name}
def getAllAccounts(self, force=False):
@@ -262,8 +262,10 @@ class Account(Base):
return False if self.selectAccount() == (None, None) else True
- def parseTraffic(self, string): #returns kbyte
- return parseFileSize(string)
+ def parseTraffic(self, value, unit=None): #: return bytes
+ if not unit and not isinstance(value, basestring):
+ unit = "KB"
+ return parseFileSize(value, unit)
def wrongPassword(self):