From bb5a115533711fd8bb87f53cb32ff7342137208d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Apr 2015 00:29:55 +0200 Subject: Spare code cosmetics (5) --- pyload/plugin/Plugin.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'pyload/plugin/Plugin.py') 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 -- cgit v1.2.3