summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-26 02:31:54 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-26 02:31:54 +0200
commit9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 (patch)
tree3b7b96651b12a2fb4765a3961a19bf3c67d4b64f /module/plugins/hooks
parentAvoid gettext conflict due variable `_` (diff)
downloadpyload-9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2.tar.xz
Extend translation support in plugins + a lot of code cosmetics and typo fixes
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/BypassCaptcha.py2
-rwxr-xr-xmodule/plugins/hooks/Captcha9kw.py8
-rw-r--r--module/plugins/hooks/Checksum.py6
-rw-r--r--module/plugins/hooks/ExpertDecoders.py2
-rw-r--r--module/plugins/hooks/ExtractArchive.py12
-rw-r--r--module/plugins/hooks/IRCInterface.py6
-rw-r--r--module/plugins/hooks/PremiumizeMe.py2
-rw-r--r--module/plugins/hooks/UpdateManager.py6
8 files changed, 22 insertions, 22 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index a07b2fc66..ef7ba01c3 100644
--- a/module/plugins/hooks/BypassCaptcha.py
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -92,7 +92,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."), e
+ self.logError(_("Could not send response"), repr(e))
def newCaptchaTask(self, task):
diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py
index 930293002..7bbfa2e73 100755
--- a/module/plugins/hooks/Captcha9kw.py
+++ b/module/plugins/hooks/Captcha9kw.py
@@ -137,9 +137,9 @@ class Captcha9kw(Hook):
self.logInfo(_("Request correct"), response)
except BadHeader, e:
- self.logError(_("Could not send correct request."), e)
+ self.logError(_("Could not send correct request"), repr(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):
@@ -157,6 +157,6 @@ class Captcha9kw(Hook):
self.logInfo(_("Request refund"), response)
except BadHeader, e:
- self.logError(_("Could not send refund request."), e)
+ self.logError(_("Could not send refund request"), repr(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/Checksum.py b/module/plugins/hooks/Checksum.py
index 4a7cfd661..bcd1139d9 100644
--- a/module/plugins/hooks/Checksum.py
+++ b/module/plugins/hooks/Checksum.py
@@ -120,7 +120,7 @@ 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:
@@ -130,7 +130,7 @@ class Checksum(Hook):
else:
self.logWarning(_("Unsupported hashing algorithm"), key.upper())
else:
- self.logWarning(_("Unable to validate checksum for file"), pyfile.name)
+ self.logWarning(_("Unable to validate checksum for file: ") + pyfile.name)
def checkFailed(self, pyfile, local_file, msg):
@@ -174,7 +174,7 @@ 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)") %
diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py
index e786cc35a..f1d949544 100644
--- a/module/plugins/hooks/ExpertDecoders.py
+++ b/module/plugins/hooks/ExpertDecoders.py
@@ -96,4 +96,4 @@ class ExpertDecoders(Hook):
self.logInfo(_("Request refund"), response)
except BadHeader, e:
- self.logError(_("Could not send refund request."), e)
+ self.logError(_("Could not send refund request"), repr(e))
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 649689f6e..8164b3157 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -98,12 +98,12 @@ class ExtractArchive(Hook):
if e.errno == 2:
self.logInfo(_("No %s installed") % p)
else:
- self.logWarning(_("Could not activate %s") % p, e)
+ self.logWarning(_("Could not activate %s") % p, repr(e))
if self.core.debug:
print_exc()
except Exception, e:
- self.logWarning(_("Could not activate %s") % p, e)
+ self.logWarning(_("Could not activate %s") % p, repr(e))
if self.core.debug:
print_exc()
@@ -202,7 +202,7 @@ class ExtractArchive(Hook):
password = p.password.strip().splitlines()
new_files = self._extract(klass, fid, password, thread)
except Exception, e:
- self.logError(basename(target), e)
+ self.logError(basename(target), repr(e))
success = False
continue
@@ -289,13 +289,13 @@ class ExtractArchive(Hook):
return extracted_files
except ArchiveError, e:
- self.logError(basename(plugin.file), _("Archive Error"), e)
+ self.logError(basename(plugin.file), _("Archive Error"), repr(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"), e)
+ self.logError(basename(plugin.file), _("Unknown Error"), repr(e))
self.manager.dispatchEvent("archive_extract_failed", pyfile)
raise Exception(_("Extract failed"))
@@ -352,4 +352,4 @@ class ExtractArchive(Hook):
gid = getgrnam(self.config['permission']['group'])[2]
chown(f, uid, gid)
except Exception, e:
- self.logWarning(_("Setting User and Group failed"), e)
+ self.logWarning(_("Setting User and Group failed"), repr(e))
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py
index 59977b8af..9a23951cf 100644
--- a/module/plugins/hooks/IRCInterface.py
+++ b/module/plugins/hooks/IRCInterface.py
@@ -156,15 +156,15 @@ class IRCInterface(Thread, Hook):
# HANDLE CTCP ANTI FLOOD/BOT PROTECTION
if msg['text'] == "\x01VERSION\x01":
- self.logDebug("Sending CTCP VERSION.")
+ self.logDebug("Sending CTCP VERSION")
self.sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface"))
return
elif msg['text'] == "\x01TIME\x01":
- self.logDebug("Sending CTCP TIME.")
+ self.logDebug("Sending CTCP TIME")
self.sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time()))
return
elif msg['text'] == "\x01LAG\x01":
- self.logDebug("Received CTCP LAG.") # don't know how to answer
+ self.logDebug("Received CTCP LAG") #: don't know how to answer
return
trigger = "pass"
diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py
index 1ef82612e..2adeadb75 100644
--- a/module/plugins/hooks/PremiumizeMe.py
+++ b/module/plugins/hooks/PremiumizeMe.py
@@ -48,7 +48,7 @@ class PremiumizeMe(MultiHoster):
self.account = self.core.accountManager.getAccountPlugin("PremiumizeMe")
if not self.account.canUse():
self.account = None
- self.logError(_("Please add a valid premiumize.me account first and restart pyLoad."))
+ self.logError(_("Please add a valid premiumize.me account first and restart pyLoad"))
return
# Run the overwriten core ready which actually enables the multihoster hook
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index be1d6e5fc..1bddbf967 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -218,7 +218,7 @@ class UpdateManager(Hook):
else:
raise Exception, _("Version mismatch")
except Exception, e:
- self.logError(_("Error updating plugin %s") % filename, e)
+ self.logError(_("Error updating plugin %s") % filename, repr(e))
if blacklist:
blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist))
@@ -273,7 +273,7 @@ class UpdateManager(Hook):
try:
remove(filename)
except Exception, e:
- self.logDebug("Error deleting", path.basename(filename), e)
+ self.logDebug("Error deleting", path.basename(filename), repr(e))
err = True
filename += "c"
@@ -283,7 +283,7 @@ class UpdateManager(Hook):
self.manager.deactivateHook(name)
remove(filename)
except Exception, e:
- self.logDebug("Error deleting", path.basename(filename), e)
+ self.logDebug("Error deleting", path.basename(filename), repr(e))
err = True
if not err: