summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/account
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-20 21:38:42 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-20 23:01:29 +0200
commit9327b55e147d95b5865f23788f980c7268ea03e3 (patch)
tree0260b6f90b9e6fab5548e29e44b6d66f3334c98e /pyload/plugin/account
parentPEP-8, Python Zen, refactor and reduce code (part 9 in master module/network) (diff)
downloadpyload-9327b55e147d95b5865f23788f980c7268ea03e3.tar.xz
Spare code cosmetics (7)
Diffstat (limited to 'pyload/plugin/account')
-rw-r--r--pyload/plugin/account/CloudzillaTo.py2
-rw-r--r--pyload/plugin/account/Keep2ShareCc.py2
-rw-r--r--pyload/plugin/account/MegasharesCom.py2
-rw-r--r--pyload/plugin/account/MultishareCz.py2
-rw-r--r--pyload/plugin/account/QuickshareCz.py2
-rw-r--r--pyload/plugin/account/UlozTo.py2
-rw-r--r--pyload/plugin/account/UploadedTo.py2
-rw-r--r--pyload/plugin/account/UploadingCom.py2
-rw-r--r--pyload/plugin/account/YibaishiwuCom.py2
9 files changed, 9 insertions, 9 deletions
diff --git a/pyload/plugin/account/CloudzillaTo.py b/pyload/plugin/account/CloudzillaTo.py
index af3544da9..bee7c5a17 100644
--- a/pyload/plugin/account/CloudzillaTo.py
+++ b/pyload/plugin/account/CloudzillaTo.py
@@ -21,7 +21,7 @@ class CloudzillaTo(Account):
def loadAccountInfo(self, user, req):
html = req.load("http://www.cloudzilla.to/")
- premium = True if re.search(self.PREMIUM_PATTERN, html) else False
+ premium = re.search(self.PREMIUM_PATTERN, html) is not None
return {'validuntil': -1, 'trafficleft': -1, 'premium': premium}
diff --git a/pyload/plugin/account/Keep2ShareCc.py b/pyload/plugin/account/Keep2ShareCc.py
index 6ee45c256..56ac5e9ab 100644
--- a/pyload/plugin/account/Keep2ShareCc.py
+++ b/pyload/plugin/account/Keep2ShareCc.py
@@ -46,7 +46,7 @@ class Keep2ShareCc(Account):
self.logError(e)
else:
- premium = True if validuntil > time.mktime(time.gmtime()) else False
+ premium = validuntil > time.mktime(time.gmtime())
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
if m:
diff --git a/pyload/plugin/account/MegasharesCom.py b/pyload/plugin/account/MegasharesCom.py
index 42ecfc17d..593583a0e 100644
--- a/pyload/plugin/account/MegasharesCom.py
+++ b/pyload/plugin/account/MegasharesCom.py
@@ -23,7 +23,7 @@ class MegasharesCom(Account):
#self.relogin(user)
html = req.load("http://d01.megashares.com/myms.php", decode=True)
- premium = False if '>Premium Upgrade<' in html else True
+ premium = '>Premium Upgrade<' not in html
validuntil = trafficleft = -1
try:
diff --git a/pyload/plugin/account/MultishareCz.py b/pyload/plugin/account/MultishareCz.py
index b743fd28a..6d41a2b18 100644
--- a/pyload/plugin/account/MultishareCz.py
+++ b/pyload/plugin/account/MultishareCz.py
@@ -25,7 +25,7 @@ class MultishareCz(Account):
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
trafficleft = self.parseTraffic(m.group('S') + m.group('U')) if m else 0
- self.premium = True if trafficleft else False
+ self.premium = bool(trafficleft)
html = req.load("http://www.multishare.cz/", decode=True)
mms_info = dict(re.findall(self.ACCOUNT_INFO_PATTERN, html))
diff --git a/pyload/plugin/account/QuickshareCz.py b/pyload/plugin/account/QuickshareCz.py
index 67dd11ac3..2f71d9ae8 100644
--- a/pyload/plugin/account/QuickshareCz.py
+++ b/pyload/plugin/account/QuickshareCz.py
@@ -24,7 +24,7 @@ class QuickshareCz(Account):
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
if m:
trafficleft = self.parseTraffic(m.group(1))
- premium = True if trafficleft else False
+ premium = bool(trafficleft)
else:
trafficleft = None
premium = False
diff --git a/pyload/plugin/account/UlozTo.py b/pyload/plugin/account/UlozTo.py
index 34e56d325..c43246e7d 100644
--- a/pyload/plugin/account/UlozTo.py
+++ b/pyload/plugin/account/UlozTo.py
@@ -27,7 +27,7 @@ class UlozTo(Account):
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
trafficleft = float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048 if m else 0
- premium = True if trafficleft else False
+ premium = bool(trafficleft)
return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': premium}
diff --git a/pyload/plugin/account/UploadedTo.py b/pyload/plugin/account/UploadedTo.py
index 61765faf8..1b8ae5b27 100644
--- a/pyload/plugin/account/UploadedTo.py
+++ b/pyload/plugin/account/UploadedTo.py
@@ -28,7 +28,7 @@ class UploadedTo(Account):
html = req.load("http://uploaded.net/me")
- premium = True if re.search(self.PREMIUM_PATTERN, html) else False
+ premium = re.search(self.PREMIUM_PATTERN, html) is not None
m = re.search(self.VALID_UNTIL_PATTERN, html, re.M)
if m:
diff --git a/pyload/plugin/account/UploadingCom.py b/pyload/plugin/account/UploadingCom.py
index f5333dd4c..992e63615 100644
--- a/pyload/plugin/account/UploadingCom.py
+++ b/pyload/plugin/account/UploadingCom.py
@@ -28,7 +28,7 @@ class UploadingCom(Account):
html = req.load("http://uploading.com/")
- premium = False if re.search(self.PREMIUM_PATTERN, html) else True
+ premium = re.search(self.PREMIUM_PATTERN, html) is None
m = re.search(self.VALID_UNTIL_PATTERN, html)
if m:
diff --git a/pyload/plugin/account/YibaishiwuCom.py b/pyload/plugin/account/YibaishiwuCom.py
index ad9b089a9..0a15c29de 100644
--- a/pyload/plugin/account/YibaishiwuCom.py
+++ b/pyload/plugin/account/YibaishiwuCom.py
@@ -23,7 +23,7 @@ class YibaishiwuCom(Account):
html = req.load("http://115.com/", decode=True)
m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S)
- premium = True if m and 'is_vip: 1' in m.group(1) else False
+ premium = m and 'is_vip: 1' in m.group(1)
validuntil = trafficleft = (-1 if m else 0)
return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium})