diff options
Diffstat (limited to 'module/plugins/hooks')
28 files changed, 87 insertions, 90 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index d62de24a7..93723681a 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -74,7 +74,7 @@ class BypassCaptcha(Hook): result = data['Value'] ticket = data['TaskId'] - self.logDebug("result %s : %s" % (ticket, result)) + self.logDebug("Result %s : %s" % (ticket, result)) return ticket, result @@ -83,7 +83,7 @@ class BypassCaptcha(Hook): response = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}) except BadHeader, e: - self.logError("Could not send response.", str(e)) + self.logError(_("Could not send response."), e def newCaptchaTask(self, task): if "service" in task.data: @@ -105,7 +105,7 @@ class BypassCaptcha(Hook): start_new_thread(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.__name__) def captchaCorrect(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 1b7406edd..7a54bb784 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -58,7 +58,7 @@ class Captcha9kw(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() data = b64encode(data) - self.logDebug("%s : %s" % (task.captchaFile, data)) + self.logDebug(task.captchaFile, data) if task.isPositional(): mouse = 1 else: @@ -93,10 +93,10 @@ class Captcha9kw(Hook): result = response2 task.data['ticket'] = response - self.logInfo("result %s : %s" % (response, result)) + self.logInfo(_("Result %s : %s") % (response, result)) task.setResult(result) else: - self.logError("Bad upload: %s" % response) + self.logError(_("Bad upload"), response) return False def newCaptchaTask(self, task): @@ -129,12 +129,12 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo("Request correct: %s" % response) + self.logInfo(_("Request correct", response) except BadHeader, e: - self.logError("Could not send correct request.", str(e)) + self.logError(_("Could not send correct request."), e) else: - self.logError("No CaptchaID for correct request (task %s) found." % task) + self.logError(_("No CaptchaID for correct request (task %s) found.") % task) def captchaInvalid(self, task): if "ticket" in task.data: @@ -148,9 +148,9 @@ class Captcha9kw(Hook): "pyload": "1", "source": "pyload", "id": task.data['ticket']}) - self.logInfo("Request refund: %s" % response) + self.logInfo(_("Request refund", response) except BadHeader, e: - self.logError("Could not send refund request.", str(e)) + self.logError(_("Could not send refund request."), e) else: - self.logError("No CaptchaID for not correct request (task %s) found." % task) + self.logError(_("No CaptchaID for not correct request (task %s) found.") % task) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index e240cbbc0..e4d24c366 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -139,7 +139,7 @@ class CaptchaBrotherhood(Hook): task.setWaiting(100) start_new_thread(self.processCaptcha, (task,)) else: - self.logInfo("Your CaptchaBrotherhood Account has not enough credits") + self.logInfo(_("Your CaptchaBrotherhood Account has not enough credits")) def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 013172899..525eb8150 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -62,7 +62,7 @@ class Checksum(Hook): def coreReady(self): if not self.getConfig("check_checksum"): - self.logInfo("Checksum validation is disabled in plugin configuration") + self.logInfo(_("Checksum validation is disabled in plugin configuration")) def setup(self): self.algorithms = sorted( @@ -101,7 +101,7 @@ class Checksum(Hook): api_size = int(data['size']) file_size = getsize(local_file) if api_size != file_size: - self.logWarning("File %s has incorrect size: %d B (%d expected)" % (pyfile.name, file_size, api_size)) + self.logWarning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) self.checkFailed(pyfile, local_file, "Incorrect file size") del data['size'] @@ -115,17 +115,17 @@ class Checksum(Hook): checksum = computeChecksum(local_file, key.replace("-", "").lower()) if checksum: if checksum == data[key].lower(): - self.logInfo('File integrity of "%s" verified by %s checksum (%s).' % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % (pyfile.name, key.upper(), checksum)) break else: - self.logWarning("%s checksum for file %s does not match (%s != %s)" % + self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % (key.upper(), pyfile.name, checksum, data[key])) self.checkFailed(pyfile, local_file, "Checksums do not match") else: - self.logWarning("Unsupported hashing algorithm: %s" % key.upper()) + self.logWarning(_("Unsupported hashing algorithm"), key.upper()) else: - self.logWarning("Unable to validate checksum for file %s" % pyfile.name) + self.logWarning(_("Unable to validate checksum for file"), pyfile.name) def checkFailed(self, pyfile, local_file, msg): check_action = self.getConfig("check_action") @@ -147,14 +147,13 @@ class Checksum(Hook): for link in pypack.getChildren().itervalues(): file_type = splitext(link['name'])[1][1:].lower() - #self.logDebug(link, file_type) if file_type not in self.formats: continue hash_file = fs_encode(save_join(download_folder, link['name'])) if not isfile(hash_file): - self.logWarning("File not found: %s" % link['name']) + self.logWarning(_("File not found"), link['name']) continue with open(hash_file) as f: @@ -168,8 +167,8 @@ class Checksum(Hook): algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) if checksum == data['hash']: - self.logInfo('File integrity of "%s" verified by %s checksum (%s).' % + self.logInfo(_('File integrity of "%s" verified by %s checksum (%s).') % (data['name'], algorithm, checksum)) else: - self.logWarning("%s checksum for file %s does not match (%s != %s)" % + self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % (algorithm, data['name'], checksum, data['hash'])) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 5c523caf7..2bff53d7e 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -30,7 +30,7 @@ class ClickAndLoad(Hook): thread.start_new_thread(proxy, (self, ip, self.port, 9666)) except: - self.logError("ClickAndLoad port already in use.") + self.logError(_("ClickAndLoad port already in use")) def proxy(self, *settings): diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 530395d32..0340aefce 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -146,7 +146,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException('timed-out') result = response['text'] - self.logDebug("result %s : %s" % (ticket, result)) + self.logDebug("Result %s : %s" % (ticket, result)) return ticket, result @@ -171,8 +171,9 @@ class DeathByCaptcha(Hook): return False balance, rate = self.info['balance'], self.info['rate'] - self.logInfo("Account balance: US$%.3f (%d captchas left at %.2f cents each)" % (balance / 100, - balance // rate, rate)) + self.logInfo(_("Account balance"), + _("US$%.3f (%d captchas left at %.2f cents each)") % (balance / 100, + balance // rate, rate)) if balance > rate: task.handler.append(self) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index bc926906f..3db0400a1 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -23,8 +23,8 @@ class DeleteFinished(Hook): if not self.info['sleep']: deloffline = self.getConfig('deloffline') mode = '0,1,4' if deloffline else '0,4' - msg = 'delete all finished packages in queue list (%s packages with offline links)' - self.logInfo(msg % ('including' if deloffline else 'excluding')) + msg = _('delete all finished packages in queue list (%s packages with offline links)') + self.logInfo(msg % (_('including') if deloffline else _('excluding'))) self.deleteFinished(mode) self.info['sleep'] = True self.addEvent('packageFinished', self.wakeup) @@ -58,7 +58,7 @@ class DeleteFinished(Hook): """Adds an event listener for event name""" if event in self.m.events: if func in self.m.events[event]: - self.logDebug('Function already registered %s' % func) + self.logDebug("Function already registered", func) else: self.m.events[event].append(func) else: diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index a3d70b3ab..4652f9a1f 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -35,7 +35,7 @@ class DownloadScheduler(Hook): schedule = re.findall("(\d{1,2}):(\d{2})[\s]*(-?\d+)", schedule.lower().replace("full", "-1").replace("none", "0")) if not schedule: - self.logError("Invalid schedule") + self.logError(_("Invalid schedule")) return t0 = localtime() @@ -58,7 +58,7 @@ class DownloadScheduler(Hook): def setDownloadSpeed(self, speed): if speed == 0: abort = self.getConfig("abort") - self.logInfo("Stopping download server. (Running downloads will %sbe aborted.)" % ('' if abort else 'not ')) + self.logInfo(_("Stopping download server. (Running downloads will %sbe aborted.)") % '' if abort else _('not ')) self.core.api.pauseServer() if abort: self.core.api.stopAllDownloads() @@ -66,10 +66,10 @@ class DownloadScheduler(Hook): self.core.api.unpauseServer() if speed > 0: - self.logInfo("Setting download speed to %d kB/s" % speed) + self.logInfo(_("Setting download speed to %d kB/s") % speed) self.core.api.setConfigValue("download", "limit_speed", 1) self.core.api.setConfigValue("download", "max_speed", speed) else: - self.logInfo("Setting download speed to FULL") + self.logInfo(_("Setting download speed to FULL")) self.core.api.setConfigValue("download", "limit_speed", 0) self.core.api.setConfigValue("download", "max_speed", -1) diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index da37297d9..a84dc5279 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -31,7 +31,7 @@ class EasybytezCom(MultiHoster): return m.group(1).split(',') except Exception, e: self.logDebug(e) - self.logWarning("Unable to load supported hoster list, using last known") + self.logWarning(_("Unable to load supported hoster list, using last known")) return ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com", "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to", "uploaded.to"] diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index c54c38bc6..881cb36ef 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -67,15 +67,14 @@ class Ev0InFetcher(Hook): if show.lower() in normalizefiletitle(item['title']) and lastfound < int(mktime(item.date_parsed)): links = self.filterLinks(item['description'].split("<br />")) packagename = item['title'].encode("utf-8") - self.logInfo("Ev0InFetcher: new episode '%s' (matched '%s')" % (packagename, show)) + self.logInfo(_("New episode '%s' (matched '%s')") % (packagename, show)) self.core.api.addPackage(packagename, links, 1 if self.getConfig("queue") else 0) self.setStorage("show_%s_lastfound" % show, int(mktime(item.date_parsed))) found = True if not found: - #self.logDebug("Ev0InFetcher: no new episodes found") pass for show, lastfound in self.getStorage().iteritems(): if int(lastfound) > 0 and int(lastfound) + (3600 * 24 * 30) < int(time()): self.delStorage("show_%s_lastfound" % show) - self.logDebug("Ev0InFetcher: cleaned '%s' record" % show) + self.logDebug("Cleaned '%s' record" % show) diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index c7ab80da0..06f1e9982 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -49,7 +49,6 @@ class ExpertDecoders(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() data = b64encode(data) - #self.logDebug("%s: %s : %s" % (ticket, task.captchaFile, data)) req = getRequest() #raise timeout threshold @@ -61,7 +60,7 @@ class ExpertDecoders(Hook): finally: req.close() - self.logDebug("result %s : %s" % (ticket, result)) + self.logDebug("Result %s : %s" % (ticket, result)) task.setResult(result) def newCaptchaTask(self, task): @@ -88,7 +87,7 @@ class ExpertDecoders(Hook): try: response = getURL(self.API_URL, post={"action": "refund", "key": self.getConfig("passkey"), "gen_task_id": task.data['ticket']}) - self.logInfo("Request refund: %s" % response) + self.logInfo(_("Request refund"), response) except BadHeader, e: - self.logError("Could not send refund request.", str(e)) + self.logError(_("Could not send refund request."), e) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index bdde9cd62..7576149b9 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -43,7 +43,7 @@ class ExternalScripts(Hook): for script_type, names in self.scripts.iteritems(): if names: - self.logInfo((_("Installed scripts for %s: ") % script_type) + ", ".join([basename(x) for x in names])) + self.logInfo(_("Installed scripts for"), script_type, ", ".join([basename(x) for x in names])) def initPluginType(self, folder, path): @@ -67,11 +67,11 @@ class ExternalScripts(Hook): def callScript(self, script, *args): try: cmd = [script] + [str(x) if not isinstance(x, basestring) else x for x in args] - self.logDebug("Executing %(script)s: %(cmd)s" % {"script": abspath(script), "cmd": " ".join(cmd)}) + self.logDebug("Executing", abspath(script), " ".join(cmd)) #output goes to pyload subprocess.Popen(cmd, bufsize=-1) except Exception, e: - self.logError(_("Error in %(script)s: %(error)s") % {"script": basename(script), "error": str(e)}) + self.logError(_("Error in %(script)s: %(error)s") % {"script": basename(script), "error": e}) def downloadPreparing(self, pyfile): diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 84f6eab25..34daf8f4f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -93,12 +93,12 @@ class ExtractArchive(Hook): if e.errno == 2: self.logInfo(_("No %s installed") % p) else: - self.logWarning(_("Could not activate %s") % p, str(e)) + self.logWarning(_("Could not activate %s") % p, e) if self.core.debug: print_exc() except Exception, e: - self.logWarning(_("Could not activate %s") % p, str(e)) + self.logWarning(_("Could not activate %s") % p, e) if self.core.debug: print_exc() @@ -197,16 +197,16 @@ class ExtractArchive(Hook): password = p.password.strip().splitlines() new_files = self._extract(klass, fid, password, thread) except Exception, e: - self.logError(basename(target), str(e)) + self.logError(basename(target), e) success = False continue - self.logDebug("Extracted: %s" % new_files) + self.logDebug("Extracted", new_files) self.setPermissions(new_files) for file in new_files: if not exists(file): - self.logDebug("new file %s does not exists" % file) + self.logDebug("New file %s does not exists" % file) continue if recursive and isfile(file): new_files_ids.append((file, fid)) # append as new target @@ -242,7 +242,7 @@ class ExtractArchive(Hook): success = True else: self.logInfo(basename(plugin.file), _("Password protected")) - self.logDebug("Passwords: %s" % str(passwords)) + self.logDebug("Passwords", passwords) pwlist = copy(self.getPasswords()) # remove already supplied pws from list (only local) @@ -252,7 +252,7 @@ class ExtractArchive(Hook): for pw in passwords + pwlist: try: - self.logDebug("Try password: %s" % pw) + self.logDebug("Try password", pw) if plugin.checkPassword(pw): plugin.extract(progress, pw) self.addPassword(pw) @@ -265,7 +265,7 @@ class ExtractArchive(Hook): raise Exception(_("Wrong password")) if self.core.debug: - self.logDebug("Would delete: %s" % ", ".join(plugin.getDeleteFiles())) + self.logDebug("Would delete", ", ".join(plugin.getDeleteFiles())) if deletearchive: files = plugin.getDeleteFiles() @@ -284,13 +284,13 @@ class ExtractArchive(Hook): return extracted_files except ArchiveError, e: - self.logError(basename(plugin.file), _("Archive Error"), str(e)) + self.logError(basename(plugin.file), _("Archive Error"), e) except CRCError: self.logError(basename(plugin.file), _("CRC Mismatch")) except Exception, e: if self.core.debug: print_exc() - self.logError(basename(plugin.file), _("Unknown Error"), str(e)) + self.logError(basename(plugin.file), _("Unknown Error"), e) self.manager.dispatchEvent("archive_extract_failed", pyfile) raise Exception(_("Extract failed")) diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py index 12d58ac8a..1926188e3 100644 --- a/module/plugins/hooks/FreeWayMe.py +++ b/module/plugins/hooks/FreeWayMe.py @@ -22,5 +22,5 @@ class FreeWayMe(MultiHoster): def getHoster(self): hostis = getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3}).replace("\"", "").strip() - self.logDebug("hosters: %s" % hostis) + self.logDebug("Hosters", hostis) return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 7ebc0275f..fe458328a 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -89,8 +89,8 @@ class IRCInterface(Thread, Hook): for t in self.getConfig("owner").split(): if t.strip().startswith("#"): self.sock.send("JOIN %s\r\n" % t.strip()) - self.logInfo("pyLoad IRC: Connected to %s!" % host) - self.logInfo("pyLoad IRC: Switching to listening mode!") + self.logInfo(_("Connected to"), host) + self.logInfo(_("Switching to listening mode!")) try: self.main_loop() @@ -177,7 +177,7 @@ class IRCInterface(Thread, Hook): for line in res: self.response(line, msg['origin']) except Exception, e: - self.logError("pyLoad IRC: " + repr(e)) + self.logError(repr(e)) def response(self, msg, origin=""): if origin == "": diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index d9d4e547e..a3e16b522 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -61,7 +61,7 @@ class ImageTyperz(Hook): except: raise ImageTyperzException("invalid response") - self.logInfo("Account balance: $%s left" % response) + self.logInfo(_("Account balance: $%s left") % response) return balance def submit(self, captcha, captchaType="file", match=None): @@ -118,7 +118,7 @@ class ImageTyperz(Hook): start_new_thread(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.__name__) def captchaInvalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: @@ -127,9 +127,9 @@ class ImageTyperz(Hook): "imageid": task.data['ticket']}) if response == "SUCCESS": - self.logInfo("Bad captcha solution received, requested refund") + self.logInfo(_("Bad captcha solution received, requested refund")) else: - self.logError("Bad captcha solution received, refund request failed", response) + self.logError(_("Bad captcha solution received, refund request failed"), response) def processCaptcha(self, task): c = task.captchaFile diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 1aa8f7ca1..fe2e85a01 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -52,4 +52,4 @@ class LinkdecrypterCom(Hook): dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("REGEXP: " + regexp) + self.logDebug("REGEXP", regexp) diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py index 605b04f21..81c3be07e 100644 --- a/module/plugins/hooks/MegaDebridEu.py +++ b/module/plugins/hooks/MegaDebridEu.py @@ -25,7 +25,7 @@ class MegaDebridEu(MultiHoster): if json_data['response_code'] == "ok": host_list = [element[0] for element in json_data['hosters']] else: - self.logError("Unable to retrieve hoster list") + self.logError(_("Unable to retrieve hoster list")) host_list = list() return host_list diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index a859092fb..dc8092d0a 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -44,11 +44,11 @@ class MergeFiles(Hook): download_folder = save_join(download_folder, pack.folder) for name, file_list in files.iteritems(): - self.logInfo("Starting merging of %s" % name) + self.logInfo(_("Starting merging of"), name) final_file = open(save_join(download_folder, name), "wb") for splitted_file in file_list: - self.logDebug("Merging part %s" % splitted_file) + self.logDebug("Merging part", splitted_file) pyfile = self.core.files.getFile(fid_dict[splitted_file]) pyfile.setStatus("processing") try: @@ -64,7 +64,7 @@ class MergeFiles(Hook): else: break s_file.close() - self.logDebug("Finished merging part %s" % splitted_file) + self.logDebug("Finished merging part", splitted_file) except Exception, e: print traceback.print_exc() finally: @@ -73,4 +73,4 @@ class MergeFiles(Hook): pyfile.release() final_file.close() - self.logInfo("Finished merging of %s" % name) + self.logInfo(_("Finished merging of"), name) diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index e2167b65e..418dfde71 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -44,7 +44,7 @@ class MultiHome(Hook): if iface: iface.useFor(pluginName, account) requestFactory.iface = lambda: iface.adress - self.logDebug("Multihome: using address: " + iface.adress) + self.logDebug("Using address", iface.adress) return oldGetRequest(pluginName, account) requestFactory.getRequest = getRequest diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py index bbf665b08..9b9654402 100644 --- a/module/plugins/hooks/MyfastfileCom.py +++ b/module/plugins/hooks/MyfastfileCom.py @@ -20,7 +20,7 @@ class MyfastfileCom(MultiHoster): def getHoster(self): json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True) - self.logDebug('JSON data: ' + json_data) + self.logDebug("JSON data", json_data) json_data = json_loads(json_data) return json_data['hosts'] diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index 5be0b8482..fc026a187 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -26,6 +26,6 @@ class OverLoadMe(MultiHoster): page = getURL(https + "://api.over-load.me/hoster.php", get={"auth": "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"} ).replace("\"", "").strip() - self.logDebug("Hosterlist: %s" % page) + self.logDebug("Hosterlist", page) return [x.strip() for x in page.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index d504bb83b..6917a2ead 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -30,7 +30,7 @@ class RehostTo(MultiHoster): user = self.account.selectAccount()[0] if not user: - self.logError("Rehost.to: " + _("Please add your rehost.to account first and restart pyLoad")) + self.logError(_("Please add your rehost.to account first and restart pyLoad")) return data = self.account.getAccountInfo(user) diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 3aef6f8cd..30c808b4d 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -31,7 +31,7 @@ class RestartFailed(Hook): self.logDebug("Invalid interval value, kept current") def periodical(self): - self.logInfo("Restart failed downloads") + self.logInfo(_("Restart failed downloads")) self.api.restartFailed() def setup(self): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index f25c5e2b4..685c9573d 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -22,14 +22,14 @@ class UnSkipOnFail(Hook): def downloadFailed(self, pyfile): pyfile_name = basename(pyfile.name) pid = pyfile.package().id - msg = 'look for skipped duplicates for %s (pid:%s)...' + msg = _('look for skipped duplicates for %s (pid:%s)') self.logInfo(msg % (pyfile_name, pid)) dups = self.findDuplicates(pyfile) for link in dups: # check if link is "skipped"(=4) if link.status == 4: lpid = link.packageID - self.logInfo('restart "%s" (pid:%s)...' % (pyfile_name, lpid)) + self.logInfo(_('restart "%s" (pid:%s)') % (pyfile_name, lpid)) self.setLinkStatus(link, "queued") def findDuplicates(self, pyfile): diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 546e6e6e8..6de3f4935 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -207,7 +207,7 @@ class UpdateManager(Hook): else: raise Exception, _("Version mismatch") except Exception, e: - self.logError(_("Error updating plugin %s") % filename, str(e)) + self.logError(_("Error updating plugin %s") % filename, e) if blacklist: blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist)) @@ -247,7 +247,7 @@ class UpdateManager(Hook): if not type_plugins: return - self.logDebug("Request deletion of plugins: %s" % type_plugins) + self.logDebug("Requested deletion of plugins", type_plugins) removed = [] @@ -261,7 +261,7 @@ class UpdateManager(Hook): try: remove(filename) except Exception, e: - self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e)) + self.logDebug("Error deleting", path.basename(filename), e) err = True filename += "c" @@ -271,7 +271,7 @@ class UpdateManager(Hook): self.manager.deactivateHook(name) remove(filename) except Exception, e: - self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e)) + self.logDebug("Error deleting", path.basename(filename), e) err = True if not err: diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index e19b40e22..1042d9498 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -62,7 +62,6 @@ class XFileSharingPro(Hook): return regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) - #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index c4a94a8bc..47d4d9fe4 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -84,22 +84,22 @@ class XMPPInterface(IRCInterface, JabberClient): try: self.loop() except Exception, ex: - self.logError("pyLoad XMPP: %s" % str(ex)) + self.logError(ex) def stream_state_changed(self, state, arg): """This one is called when the state of stream connecting the component to a server changes. This will usually be used to let the user know what is going on.""" - self.logDebug("pyLoad XMPP: *** State changed: %s %r ***" % (state, arg)) + self.logDebug("*** State changed: %s %r ***" % (state, arg)) def disconnected(self): - self.logDebug("pyLoad XMPP: Client was disconnected") + self.logDebug("Client was disconnected") def stream_closed(self, stream): - self.logDebug("pyLoad XMPP: Stream was closed | %s" % stream) + self.logDebug("Stream was closed", stream) def stream_error(self, err): - self.logDebug("pyLoad XMPP: Stream Error: %s" % err) + self.logDebug("Stream Error", err) def get_message_handlers(self): """Return list of (message_type, message_handler) tuples. @@ -113,8 +113,8 @@ class XMPPInterface(IRCInterface, JabberClient): subject = stanza.get_subject() body = stanza.get_body() t = stanza.get_type() - self.logDebug(u'pyLoad XMPP: Message from %s received.' % (unicode(stanza.get_from(),))) - self.logDebug(u'pyLoad XMPP: Body: %s Subject: %s Type: %s' % (body, subject, t)) + self.logDebug("Message from %s received." % unicode(stanza.get_from())) + self.logDebug("Body: %s Subject: %s Type: %s" % (body, subject, t)) if t == "headline": # 'headline' messages should never be replied to @@ -158,7 +158,7 @@ class XMPPInterface(IRCInterface, JabberClient): messages.append(m) except Exception, e: - self.logError("pyLoad XMPP: " + repr(e)) + self.logError(repr(e)) return messages @@ -171,7 +171,7 @@ class XMPPInterface(IRCInterface, JabberClient): def announce(self, message): """ send message to all owners""" for user in self.getConfig("owners").split(";"): - self.logDebug("pyLoad XMPP: Send message to %s" % user) + self.logDebug("Send message to", user) to_jid = JID(user) |