diff options
author | Armin <Armin@Armin-PC.diedering.lan> | 2015-04-16 19:38:27 +0200 |
---|---|---|
committer | Armin <Armin@Armin-PC.diedering.lan> | 2015-04-16 19:38:27 +0200 |
commit | d7ced99ef511ce9f0a81e437db2f31fce8717b23 (patch) | |
tree | 3df5e579ade317e01da47ded86d98483f0857fcb | |
parent | Merge pull request #1 from vuolter/0.4.10 (diff) | |
download | pyload-d7ced99ef511ce9f0a81e437db2f31fce8717b23.tar.xz |
fixed: more typos
-rw-r--r-- | pyload/manager/Thread.py | 6 | ||||
-rw-r--r-- | pyload/plugin/addon/ExtractArchive.py | 42 | ||||
-rw-r--r-- | pyload/plugin/crypter/XFileSharingPro.py | 6 | ||||
-rw-r--r-- | pyload/plugin/hook/BypassCaptcha.py | 16 | ||||
-rw-r--r-- | pyload/plugin/hook/CaptchaBrotherhood.py | 14 | ||||
-rw-r--r-- | pyload/plugin/hook/DeathByCaptcha.py | 8 | ||||
-rw-r--r-- | pyload/plugin/hook/ImageTyperz.py | 10 | ||||
-rw-r--r-- | pyload/plugin/hoster/FileserveCom.py | 10 | ||||
-rw-r--r-- | pyload/plugin/hoster/NoPremiumPl.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/RapideoPl.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/XFileSharingPro.py | 4 | ||||
-rw-r--r-- | pyload/plugin/hoster/Xdcc.py | 2 |
12 files changed, 61 insertions, 61 deletions
diff --git a/pyload/manager/Thread.py b/pyload/manager/Thread.py index dd1582eb7..fb302ef0a 100644 --- a/pyload/manager/Thread.py +++ b/pyload/manager/Thread.py @@ -257,11 +257,11 @@ class ThreadManager(object): free = [x for x in self.threads if not x.active] - inuse = set([((x.active.plugintype, x.active.pluginname), self.getLimit(x)) for x in self.threads if x.active and x.active.hasPlugin() and x.active.plugin.account]) - inuse = map(lambda x: ('.'.join(x[0]), x[1], len([y for y in self.threads if y.active and y.active.plugintype == x[0][0] and y.active.pluginname == x[0][1]])), inuse) + inuse = set([((x.active.plugintype, x.active.pluginname), self.getLimit(x)) for x in self.threads if x.active and isinstance(x.active, PyFile) and x.active.hasPlugin() and x.active.plugin.account]) + inuse = map(lambda x: ('.'.join(x[0]), x[1], len([y for y in self.threads if y.active and isinstance(y.active, PyFile) and y.active.plugintype == x[0][0] and y.active.pluginname == x[0][1]])), inuse) onlimit = [x[0] for x in inuse if x[1] > 0 and x[2] >= x[1]] - occ = [x.active.plugintype + '.' + x.active.pluginname for x in self.threads if x.active and x.active.hasPlugin() and not x.active.plugin.multiDL] + onlimit + occ = [x.active.plugintype + '.' + x.active.pluginname for x in self.threads if x.active and isinstance(x.active, PyFile) and x.active.hasPlugin() and not x.active.plugin.multiDL] + onlimit occ.sort() occ = tuple(set(occ)) diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py index ce67cbcaf..bc1b06306 100644 --- a/pyload/plugin/addon/ExtractArchive.py +++ b/pyload/plugin/addon/ExtractArchive.py @@ -112,30 +112,30 @@ class ExtractArchive(Addon): __version = "1.41" __config = [("activated" , "bool" , "Activated" , True ), - ("fullpath" , "bool" , "Extract with full paths" , True ), - ("overwrite" , "bool" , "Overwrite files" , False ), - ("keepbroken" , "bool" , "Try to extract broken archives" , False ), - ("repair" , "bool" , "Repair broken archives (RAR required)" , False ), - ("test" , "bool" , "Test archive before extracting" , False ), - ("usepasswordfile", "bool" , "Use password file" , True ), - ("passwordfile" , "file" , "Password file" , "archive_password.txt" ), - ("delete" , "bool" , "Delete archive after extraction" , True ), - ("deltotrash" , "bool" , "Move to trash (recycle bin) instead delete", True ), - ("subfolder" , "bool" , "Create subfolder for each package" , False ), - ("destination" , "folder" , "Extract files to folder" , "" ), - ("extensions" , "str" , "Extract archives ending with extension" , "7z,bz2,bzip2,gz,gzip,lha,lzh,lzma,rar,tar,taz,tbz,tbz2,tgz,xar,xz,z,zip"), - ("excludefiles" , "str" , "Don't extract the following files" , "*.nfo,*.DS_Store,index.dat,thumb.db" ), - ("recursive" , "bool" , "Extract archives in archives" , True ), - ("waitall" , "bool" , "Run after all downloads was processed" , False ), - ("renice" , "int" , "CPU priority" , 0 )] + ("fullpath" , "bool" , "Extract with full paths" , True ), + ("overwrite" , "bool" , "Overwrite files" , False ), + ("keepbroken" , "bool" , "Try to extract broken archives" , False ), + ("repair" , "bool" , "Repair broken archives (RAR required)" , False ), + ("test" , "bool" , "Test archive before extracting" , False ), + ("usepasswordfile", "bool" , "Use password file" , True ), + ("passwordfile" , "file" , "Password file" , "archive_password.txt" ), + ("delete" , "bool" , "Delete archive after extraction" , True ), + ("deltotrash" , "bool" , "Move to trash (recycle bin) instead delete", True ), + ("subfolder" , "bool" , "Create subfolder for each package" , False ), + ("destination" , "folder" , "Extract files to folder" , "" ), + ("extensions" , "str" , "Extract archives ending with extension" , "7z,bz2,bzip2,gz,gzip,lha,lzh,lzma,rar,tar,taz,tbz,tbz2,tgz,xar,xz,z,zip"), + ("excludefiles" , "str" , "Don't extract the following files" , "*.nfo,*.DS_Store,index.dat,thumb.db" ), + ("recursive" , "bool" , "Extract archives in archives" , True ), + ("waitall" , "bool" , "Run after all downloads was processed" , False ), + ("renice" , "int" , "CPU priority" , 0 )] __description = """Extract different kind of archives""" __license = "GPLv3" __authors = [("Walter Purcaro", "vuolter@gmail.com"), - ("Immenz" , "immenz@gmx.net" )] + ("Immenz" , "immenz@gmx.net" )] - event_list = ["allDownloadsProcessed","packageDeleted"] + event_list = ["allDownloadsProcessed", "packageDeleted"] NAME_REPLACEMENTS = [(r'\.part\d+\.rar$', ".part.rar")] @@ -295,13 +295,13 @@ class ExtractArchive(Addon): new_files_ids = [] if extensions: - files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids + files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids if filter(lambda ext: fname.lower().endswith(ext), extensions)] for Extractor in self.extractors: targets = Extractor.getTargets(files_ids) if targets: - self.logDebug("Targets for %s: %s" % (Extractor.__class__.__name__, targets)) + self.logDebug("Targets for %s: %s" % (Extractor.__name__, targets)) matched = True for fname, fid, fout in targets: @@ -341,7 +341,7 @@ class ExtractArchive(Addon): continue # remove processed file and related multiparts from list - files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids + files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids if fname not in archive.getDeleteFiles()] self.logDebug("Extracted files: %s" % new_files) self.setPermissions(new_files) diff --git a/pyload/plugin/crypter/XFileSharingPro.py b/pyload/plugin/crypter/XFileSharingPro.py index 9422789f3..c83c0c67e 100644 --- a/pyload/plugin/crypter/XFileSharingPro.py +++ b/pyload/plugin/crypter/XFileSharingPro.py @@ -12,7 +12,7 @@ class XFileSharingPro(XFSCrypter): __pattern = r'^unmatchable$' __config = [("use_subfolder" , "bool", "Save package to subfolder" , True), - ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] + ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] __description = """XFileSharingPro dummy folder decrypter plugin for hook""" __license = "GPLv3" @@ -22,13 +22,13 @@ class XFileSharingPro(XFSCrypter): def _log(self, type, args): msg = " | ".join(str(a).strip() for a in args if a) logger = getattr(self.log, type) - logger("%s: %s: %s" % (self.__name, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) + logger("%s: %s: %s" % (self.__class__.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) def init(self): super(XFileSharingPro, self).init() - self.__pattern = self.core.pluginManager.crypterPlugins[self.__name]['pattern'] + self.__pattern = self.core.pluginManager.crypterPlugins[self.__class__.__name__]['pattern'] self.HOSTER_DOMAIN = re.match(self.__pattern, self.pyfile.url).group("DOMAIN").lower() self.HOSTER_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.') diff --git a/pyload/plugin/hook/BypassCaptcha.py b/pyload/plugin/hook/BypassCaptcha.py index 141ac7282..e3fae426e 100644 --- a/pyload/plugin/hook/BypassCaptcha.py +++ b/pyload/plugin/hook/BypassCaptcha.py @@ -35,9 +35,9 @@ class BypassCaptcha(Hook): __description = """Send captchas to BypassCaptcha.com""" __license = "GPLv3" - __authors = [("RaNaN" , "RaNaN@pyload.org" ), - ("Godofdream", "soilfcition@gmail.com"), - ("zoidberg" , "zoidberg@mujmail.cz" )] + __authors = [("RaNaN" , "RaNaN@pyload.org"), + ("Godofdream", "soilfcition@gmail.com"), + ("zoidberg" , "zoidberg@mujmail.cz")] PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" @@ -84,7 +84,7 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), - "cv": 1 if success else 0}) + "cv": 1 if success else 0}) except BadHeader, e: self.logError(_("Could not send response"), e) @@ -104,21 +104,21 @@ class BypassCaptcha(Hook): if self.getCredits() > 0: task.handler.append(self) - task.data['service'] = self.__name + task.data['service'] = self.__class__.__name__ task.setWaiting(100) self._processCaptcha(task) else: - self.logInfo(_("Your %s account has not enough credits") % self.__name) + self.logInfo(_("Your %s account has not enough credits") % self.__class__.__name__) def captchaCorrect(self, task): - if task.data['service'] == self.__name and "ticket" in task.data: + if task.data['service'] == self.__class__.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], True) def captchaInvalid(self, task): - if task.data['service'] == self.__name and "ticket" in task.data: + if task.data['service'] == self.__class__.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], False) diff --git a/pyload/plugin/hook/CaptchaBrotherhood.py b/pyload/plugin/hook/CaptchaBrotherhood.py index eff005d14..15338b0af 100644 --- a/pyload/plugin/hook/CaptchaBrotherhood.py +++ b/pyload/plugin/hook/CaptchaBrotherhood.py @@ -46,8 +46,8 @@ class CaptchaBrotherhood(Hook): __description = """Send captchas to CaptchaBrotherhood.com""" __license = "GPLv3" - __authors = [("RaNaN" , "RaNaN@pyload.org" ), - ("zoidberg", "zoidberg@mujmail.cz")] + __authors = [("RaNaN" , "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] API_URL = "http://www.captchabrotherhood.com/" @@ -123,9 +123,9 @@ class CaptchaBrotherhood(Hook): def api_response(self, api, ticket): res = getURL("%s%s.aspx" % (self.API_URL, api), - get={"username": self.getConfig('username'), - "password": self.getConfig('passkey'), - "captchaID": ticket}) + get={"username": self.getConfig('username'), + "password": self.getConfig('passkey'), + "captchaID": ticket}) if not res.startswith("OK"): raise CaptchaBrotherhoodException("Unknown response: %s" % res) @@ -147,7 +147,7 @@ class CaptchaBrotherhood(Hook): if self.getCredits() > 10: task.handler.append(self) - task.data['service'] = self.__name + task.data['service'] = self.__class__.__name__ task.setWaiting(100) self._processCaptcha(task) else: @@ -155,7 +155,7 @@ class CaptchaBrotherhood(Hook): def captchaInvalid(self, task): - if task.data['service'] == self.__name and "ticket" in task.data: + if task.data['service'] == self.__class__.__name__ and "ticket" in task.data: res = self.api_response("complainCaptcha", task.data['ticket']) diff --git a/pyload/plugin/hook/DeathByCaptcha.py b/pyload/plugin/hook/DeathByCaptcha.py index 4b77c8718..b28848422 100644 --- a/pyload/plugin/hook/DeathByCaptcha.py +++ b/pyload/plugin/hook/DeathByCaptcha.py @@ -59,8 +59,8 @@ class DeathByCaptcha(Hook): __description = """Send captchas to DeathByCaptcha.com""" __license = "GPLv3" - __authors = [("RaNaN" , "RaNaN@pyload.org" ), - ("zoidberg", "zoidberg@mujmail.cz")] + __authors = [("RaNaN" , "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] API_URL = "http://api.dbcapi.me/api/" @@ -188,13 +188,13 @@ class DeathByCaptcha(Hook): if balance > rate: task.handler.append(self) - task.data['service'] = self.__name + task.data['service'] = self.__class__.__name__ task.setWaiting(180) self._processCaptcha(task) def captchaInvalid(self, task): - if task.data['service'] == self.__name and "ticket" in task.data: + if task.data['service'] == self.__class__.__name__ and "ticket" in task.data: try: res = self.api_response("captcha/%d/report" % task.data['ticket'], True) diff --git a/pyload/plugin/hook/ImageTyperz.py b/pyload/plugin/hook/ImageTyperz.py index ca5e02559..5dadc09f1 100644 --- a/pyload/plugin/hook/ImageTyperz.py +++ b/pyload/plugin/hook/ImageTyperz.py @@ -40,8 +40,8 @@ class ImageTyperz(Hook): __description = """Send captchas to ImageTyperz.com""" __license = "GPLv3" - __authors = [("RaNaN" , "RaNaN@pyload.org" ), - ("zoidberg", "zoidberg@mujmail.cz")] + __authors = [("RaNaN" , "RaNaN@pyload.org"), + ("zoidberg", "zoidberg@mujmail.cz")] SUBMIT_URL = "http://captchatypers.com/Forms/UploadFileAndGetTextNEW.ashx" @@ -118,16 +118,16 @@ class ImageTyperz(Hook): if self.getCredits() > 0: task.handler.append(self) - task.data['service'] = self.__name + task.data['service'] = self.__class__.__name__ task.setWaiting(100) self._processCaptcha(task) else: - self.logInfo(_("Your %s account has not enough credits") % self.__name) + self.logInfo(_("Your %s account has not enough credits") % self.__class__.__name__) def captchaInvalid(self, task): - if task.data['service'] == self.__name and "ticket" in task.data: + if task.data['service'] == self.__class__.__name__ and "ticket" in task.data: res = getURL(self.RESPOND_URL, post={'action': "SETBADIMAGE", 'username': self.getConfig('username'), diff --git a/pyload/plugin/hoster/FileserveCom.py b/pyload/plugin/hoster/FileserveCom.py index b275f6e86..a7bb22440 100644 --- a/pyload/plugin/hoster/FileserveCom.py +++ b/pyload/plugin/hoster/FileserveCom.py @@ -40,9 +40,9 @@ class FileserveCom(Hoster): __description = """Fileserve.com hoster plugin""" __license = "GPLv3" __authors = [("jeix", "jeix@hasnomail.de"), - ("mkaay", "mkaay@mkaay.de"), - ("Paul King", ""), - ("zoidberg", "zoidberg@mujmail.cz")] + ("mkaay", "mkaay@mkaay.de"), + ("Paul King", ""), + ("zoidberg", "zoidberg@mujmail.cz")] URLS = ["http://www.fileserve.com/file/", "http://www.fileserve.com/link-checker.php", @@ -144,7 +144,7 @@ class FileserveCom(Hoster): if "fail" in res: self.fail(_("Failed getting wait time")) - if self.__name == "FilejungleCom": + if self.__class__.__name__ == "FilejungleCom": m = re.search(r'"waitTime":(\d+)', res) if m is None: self.fail(_("Cannot get wait time")) @@ -184,7 +184,7 @@ class FileserveCom(Hoster): def handlePremium(self, pyfile): premium_url = None - if self.__name == "FileserveCom": + if self.__class__.__name__ == "FileserveCom": #try api download res = self.load("http://app.fileserve.com/api/download/premium/", post={"username": self.user, diff --git a/pyload/plugin/hoster/NoPremiumPl.py b/pyload/plugin/hoster/NoPremiumPl.py index 701ca6a6d..109932721 100644 --- a/pyload/plugin/hoster/NoPremiumPl.py +++ b/pyload/plugin/hoster/NoPremiumPl.py @@ -79,7 +79,7 @@ class NoPremiumPl(MultiHoster): if "errno" in parsed.keys(): if parsed["errno"] in self.ERROR_CODES: # error code in known - self.fail(self.ERROR_CODES[parsed["errno"]] % self.__name) + self.fail(self.ERROR_CODES[parsed["errno"]] % self.__class__.__name__) else: # error code isn't yet added to plugin self.fail( diff --git a/pyload/plugin/hoster/RapideoPl.py b/pyload/plugin/hoster/RapideoPl.py index 88a596dc7..70e3fd853 100644 --- a/pyload/plugin/hoster/RapideoPl.py +++ b/pyload/plugin/hoster/RapideoPl.py @@ -79,7 +79,7 @@ class RapideoPl(MultiHoster): if "errno" in parsed.keys(): if parsed["errno"] in self.ERROR_CODES: # error code in known - self.fail(self.ERROR_CODES[parsed["errno"]] % self.__name) + self.fail(self.ERROR_CODES[parsed["errno"]] % self.__class__.__name__) else: # error code isn't yet added to plugin self.fail( diff --git a/pyload/plugin/hoster/XFileSharingPro.py b/pyload/plugin/hoster/XFileSharingPro.py index 0696674df..8274a818a 100644 --- a/pyload/plugin/hoster/XFileSharingPro.py +++ b/pyload/plugin/hoster/XFileSharingPro.py @@ -23,13 +23,13 @@ class XFileSharingPro(XFSHoster): def _log(self, type, args): msg = " | ".join(str(a).strip() for a in args if a) logger = getattr(self.log, type) - logger("%s: %s: %s" % (self.__name, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) + logger("%s: %s: %s" % (self.__class__.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) def init(self): super(XFileSharingPro, self).init() - self.__pattern = self.core.pluginManager.hosterPlugins[self.__name]['pattern'] + self.__pattern = self.core.pluginManager.hosterPlugins[self.__class__.__name__]['pattern'] self.HOSTER_DOMAIN = re.match(self.__pattern, self.pyfile.url).group("DOMAIN").lower() self.HOSTER_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.') diff --git a/pyload/plugin/hoster/Xdcc.py b/pyload/plugin/hoster/Xdcc.py index ff8d2c3b8..587c73157 100644 --- a/pyload/plugin/hoster/Xdcc.py +++ b/pyload/plugin/hoster/Xdcc.py @@ -36,7 +36,7 @@ class Xdcc(Hoster): def process(self, pyfile): # change request type - self.req = pyfile.m.core.requestFactory.getRequest(self.__name, type="XDCC") + self.req = pyfile.m.core.requestFactory.getRequest(self.__class__.__name__, type="XDCC") self.pyfile = pyfile for _i in xrange(0, 3): |