From aaaf5a4cddec894aacd7400c59a9f2f5e710362f Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 22 Jul 2013 20:50:34 +0200 Subject: Fixed PEP 8 violations in Hosters (cherry picked from commit 2edeee0532ec6d6b4b26fd045a5971f67ca455da) Conflicts: pyload/plugins/hoster/BasePlugin.py pyload/plugins/hoster/MultishareCz.py pyload/plugins/hoster/NetloadIn.py pyload/plugins/hoster/PremiumizeMe.py pyload/plugins/hoster/RapidshareCom.py --- pyload/plugins/hoster/FilesMailRu.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'pyload/plugins/hoster/FilesMailRu.py') diff --git a/pyload/plugins/hoster/FilesMailRu.py b/pyload/plugins/hoster/FilesMailRu.py index c7232f5dd..6ce3a9e01 100644 --- a/pyload/plugins/hoster/FilesMailRu.py +++ b/pyload/plugins/hoster/FilesMailRu.py @@ -5,6 +5,7 @@ import re from module.plugins.Hoster import Hoster, chunks from module.network.RequestFactory import getURL + def getInfo(urls): result = [] for chunk in chunks(urls, 10): @@ -22,11 +23,11 @@ def getInfo(urls): except: pass - # status 1=OFFLINE, 2=OK, 3=UNKNOWN # result.append((#name,#size,#status,#url)) yield result + class FilesMailRu(Hoster): __name__ = "FilesMailRu" __type__ = "hoster" @@ -36,7 +37,6 @@ class FilesMailRu(Hoster): __author_name__ = ("oZiRiz") __author_mail__ = ("ich@oziriz.de") - def setup(self): if not self.account: self.multiDL = False @@ -45,17 +45,17 @@ class FilesMailRu(Hoster): def process(self, pyfile): self.html = self.load(pyfile.url) self.url_pattern = '(.+?)' - + #marks the file as "offline" when the pattern was found on the html-page''' if r'
' in self.html: self.offline() - + elif r'Page cannot be displayed' in self.html: self.offline() - + #the filename that will be showed in the list (e.g. test.part1.rar)''' pyfile.name = self.getFileName() - + #prepare and download''' if not self.account: self.prepare() @@ -66,25 +66,25 @@ class FilesMailRu(Hoster): self.myPostProcess() def prepare(self): - '''You have to wait some seconds. Otherwise you will get a 40Byte HTML Page instead of the file you expected''' + """You have to wait some seconds. Otherwise you will get a 40Byte HTML Page instead of the file you expected""" self.setWait(10) self.wait() return True - + def getFileUrl(self): - '''gives you the URL to the file. Extracted from the Files.mail.ru HTML-page stored in self.html''' - file_url = re.search(self.url_pattern, self.html).group(0).split('')[1].split('')[0] return file_name - + def myPostProcess(self): - # searches the file for HTMl-Code. Sometimes the Redirect - # doesn't work (maybe a curl Problem) and you get only a small + # searches the file for HTMl-Code. Sometimes the Redirect + # doesn't work (maybe a curl Problem) and you get only a small # HTML file and the Download is marked as "finished" # then the download will be restarted. It's only bad for these # who want download a HTML-File (it's one in a million ;-) ) @@ -95,5 +95,7 @@ class FilesMailRu(Hoster): # (Loading 100MB in to ram is not an option) check = self.checkDownload({"html": "