diff options
Diffstat (limited to 'pyload/plugin')
-rw-r--r-- | pyload/plugin/Account.py | 6 | ||||
-rw-r--r-- | pyload/plugin/Addon.py | 1 | ||||
-rw-r--r-- | pyload/plugin/Plugin.py | 13 | ||||
-rw-r--r-- | pyload/plugin/account/NoPremiumPl.py | 2 | ||||
-rw-r--r-- | pyload/plugin/account/RapideoPl.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/BitshareCom.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/MegaRapidoNet.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/SimplyPremiumCom.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/UpstoreNet.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/Xdcc.py | 2 | ||||
-rw-r--r-- | pyload/plugin/internal/SimpleHoster.py | 3 |
11 files changed, 21 insertions, 16 deletions
diff --git a/pyload/plugin/Account.py b/pyload/plugin/Account.py index bc13c0497..c46eae5e3 100644 --- a/pyload/plugin/Account.py +++ b/pyload/plugin/Account.py @@ -231,7 +231,8 @@ class Account(Base): """ returns an valid account name and data""" usable = [] for user, data in self.accounts.iteritems(): - if not data['valid']: continue + if not data['valid']: + continue if "time" in data['options'] and data['options']['time']: time_data = "" @@ -253,7 +254,8 @@ class Account(Base): usable.append((user, data)) - if not usable: return None, None + if not usable: + return None, None return choice(usable) diff --git a/pyload/plugin/Addon.py b/pyload/plugin/Addon.py index 35f010f29..bb90428e4 100644 --- a/pyload/plugin/Addon.py +++ b/pyload/plugin/Addon.py @@ -16,7 +16,6 @@ class Expose(object): def threaded(fn): - def run(*args,**kwargs): addonManager.startThread(fn, *args, **kwargs) diff --git a/pyload/plugin/Plugin.py b/pyload/plugin/Plugin.py index c18e16643..54963447c 100644 --- a/pyload/plugin/Plugin.py +++ b/pyload/plugin/Plugin.py @@ -57,6 +57,7 @@ class Base(object): A Base class with log/config/db methods *all* plugin types can use """ + def __init__(self, core): #: Core instance self.core = core @@ -568,7 +569,8 @@ class Plugin(Base): header = {"code": self.req.code} for line in res.splitlines(): line = line.strip() - if not line or ":" not in line: continue + if not line or ":" not in line: + continue key, none, value = line.partition(":") key = key.strip().lower() @@ -693,8 +695,10 @@ class Plugin(Base): size = stat(lastDownload) size = size.st_size - if api_size and api_size <= size: return None - elif size > max_size and not read_size: return None + if api_size and api_size <= size: + return None + elif size > max_size and not read_size: + return None self.logDebug("Download Check triggered") with open(lastDownload, "rb") as f: @@ -720,7 +724,8 @@ class Plugin(Base): def getPassword(self): """ get the password the user provided in the package""" password = self.pyfile.package().password - if not password: return "" + if not password: + return "" return password diff --git a/pyload/plugin/account/NoPremiumPl.py b/pyload/plugin/account/NoPremiumPl.py index 98f472848..6cefed550 100644 --- a/pyload/plugin/account/NoPremiumPl.py +++ b/pyload/plugin/account/NoPremiumPl.py @@ -37,7 +37,7 @@ class NoPremiumPl(Account): try: result = json_loads(self.runAuthQuery()) except Exception: - # todo: return or let it be thrown? + #@TODO: return or let it be thrown? return premium = False diff --git a/pyload/plugin/account/RapideoPl.py b/pyload/plugin/account/RapideoPl.py index d1cb47826..c58414b53 100644 --- a/pyload/plugin/account/RapideoPl.py +++ b/pyload/plugin/account/RapideoPl.py @@ -37,7 +37,7 @@ class RapideoPl(Account): try: result = json_loads(self.runAuthQuery()) except Exception: - # todo: return or let it be thrown? + #@TODO: return or let it be thrown? return premium = False diff --git a/pyload/plugin/hoster/BitshareCom.py b/pyload/plugin/hoster/BitshareCom.py index afea970eb..0d26c2d53 100644 --- a/pyload/plugin/hoster/BitshareCom.py +++ b/pyload/plugin/hoster/BitshareCom.py @@ -114,7 +114,7 @@ class BitshareCom(SimpleHoster): recaptcha = ReCaptcha(self) # Try up to 3 times - for i in xrange(3): + for _i in xrange(3): response, challenge = recaptcha.challenge() res = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", post={"request" : "validateCaptcha", diff --git a/pyload/plugin/hoster/MegaRapidoNet.py b/pyload/plugin/hoster/MegaRapidoNet.py index d0c3ad917..311189d1c 100644 --- a/pyload/plugin/hoster/MegaRapidoNet.py +++ b/pyload/plugin/hoster/MegaRapidoNet.py @@ -8,7 +8,7 @@ from pyload.plugin.internal.MultiHoster import MultiHoster def random_with_N_digits(n): rand = "0." not_zero = 0 - for i in range(1, n + 1): + for _i in range(1, n + 1): r = randint(0, 9) if(r > 0): not_zero += 1 diff --git a/pyload/plugin/hoster/SimplyPremiumCom.py b/pyload/plugin/hoster/SimplyPremiumCom.py index 51b5ac577..327bfdcc1 100644 --- a/pyload/plugin/hoster/SimplyPremiumCom.py +++ b/pyload/plugin/hoster/SimplyPremiumCom.py @@ -46,7 +46,7 @@ class SimplyPremiumCom(MultiHoster): def handlePremium(self, pyfile): - for i in xrange(5): + for _i in xrange(5): self.html = self.load("http://www.simply-premium.com/premium.php", get={'info': "", 'link': self.pyfile.url}) if self.html: diff --git a/pyload/plugin/hoster/UpstoreNet.py b/pyload/plugin/hoster/UpstoreNet.py index 27fc68dc6..adf63e382 100644 --- a/pyload/plugin/hoster/UpstoreNet.py +++ b/pyload/plugin/hoster/UpstoreNet.py @@ -43,7 +43,7 @@ class UpstoreNet(SimpleHoster): recaptcha = ReCaptcha(self) # try the captcha 5 times - for i in xrange(5): + for _i in xrange(5): m = re.search(self.WAIT_PATTERN, self.html) if m is None: self.error(_("Wait pattern not found")) diff --git a/pyload/plugin/hoster/Xdcc.py b/pyload/plugin/hoster/Xdcc.py index f2b5d0b8f..42491404f 100644 --- a/pyload/plugin/hoster/Xdcc.py +++ b/pyload/plugin/hoster/Xdcc.py @@ -117,7 +117,7 @@ class Xdcc(Hoster): sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) else: - if (dl_time + self.timeout) < time.time(): # todo: add in config + if (dl_time + self.timeout) < time.time(): #@TODO: add in config sock.send("QUIT :byebye\r\n") sock.close() self.fail(_("XDCC Bot did not answer")) diff --git a/pyload/plugin/internal/SimpleHoster.py b/pyload/plugin/internal/SimpleHoster.py index 642ec2df7..930f5a313 100644 --- a/pyload/plugin/internal/SimpleHoster.py +++ b/pyload/plugin/internal/SimpleHoster.py @@ -652,9 +652,8 @@ class SimpleHoster(Hoster): self.checkStatus(getinfo=False) - #: Deprecated - + #: Deprecated def getFileInfo(self): self.info = {} self.checkInfo() |