summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/BypassCaptcha.py2
-rwxr-xr-xmodule/plugins/hooks/Captcha9kw.py4
-rw-r--r--module/plugins/hooks/ExpertDecoders.py2
-rw-r--r--module/plugins/hooks/ExtractArchive.py12
-rw-r--r--module/plugins/hooks/IRCInterface.py2
-rw-r--r--module/plugins/hooks/MergeFiles.py5
-rw-r--r--module/plugins/hooks/UpdateManager.py6
-rw-r--r--module/plugins/hooks/XMPPInterface.py2
8 files changed, 18 insertions, 17 deletions
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index ef7ba01c3..d4c41b02a 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"), repr(e))
+ self.logError(_("Could not send response"), str(e))
def newCaptchaTask(self, task):
diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py
index 7bbfa2e73..eb6313bc0 100755
--- a/module/plugins/hooks/Captcha9kw.py
+++ b/module/plugins/hooks/Captcha9kw.py
@@ -137,7 +137,7 @@ class Captcha9kw(Hook):
self.logInfo(_("Request correct"), response)
except BadHeader, e:
- self.logError(_("Could not send correct request"), repr(e))
+ self.logError(_("Could not send correct request"), str(e))
else:
self.logError(_("No CaptchaID for correct request (task %s) found") % task)
@@ -157,6 +157,6 @@ class Captcha9kw(Hook):
self.logInfo(_("Request refund"), response)
except BadHeader, e:
- self.logError(_("Could not send refund request"), repr(e))
+ self.logError(_("Could not send refund request"), str(e))
else:
self.logError(_("No CaptchaID for not correct request (task %s) found") % task)
diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py
index f1d949544..d112b3a35 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"), repr(e))
+ self.logError(_("Could not send refund request"), str(e))
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 8164b3157..4a4f2d4d8 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, repr(e))
+ self.logWarning(_("Could not activate %s") % p, str(e))
if self.core.debug:
print_exc()
except Exception, e:
- self.logWarning(_("Could not activate %s") % p, repr(e))
+ self.logWarning(_("Could not activate %s") % p, str(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), repr(e))
+ self.logError(basename(target), str(e))
success = False
continue
@@ -289,13 +289,13 @@ class ExtractArchive(Hook):
return extracted_files
except ArchiveError, e:
- self.logError(basename(plugin.file), _("Archive Error"), repr(e))
+ self.logError(basename(plugin.file), _("Archive Error"), str(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"), repr(e))
+ self.logError(basename(plugin.file), _("Unknown Error"), str(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"), repr(e))
+ self.logWarning(_("Setting User and Group failed"), str(e))
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py
index 9a23951cf..061714757 100644
--- a/module/plugins/hooks/IRCInterface.py
+++ b/module/plugins/hooks/IRCInterface.py
@@ -184,7 +184,7 @@ class IRCInterface(Thread, Hook):
for line in res:
self.response(line, msg['origin'])
except Exception, e:
- self.logError(repr(e))
+ self.logError(str(e))
def response(self, msg, origin=""):
diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py
index 0eab0037c..7562df2a8 100644
--- a/module/plugins/hooks/MergeFiles.py
+++ b/module/plugins/hooks/MergeFiles.py
@@ -2,7 +2,8 @@
import os
import re
-import traceback
+
+from traceback import print_exc
from module.plugins.Hook import Hook, threaded
from module.utils import save_join, fs_encode
@@ -68,7 +69,7 @@ class MergeFiles(Hook):
s_file.close()
self.logDebug("Finished merging part", splitted_file)
except Exception, e:
- print traceback.print_exc()
+ print_exc()
finally:
pyfile.setProgress(100)
pyfile.setStatus("finished")
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index 1bddbf967..d5fb43ddc 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, repr(e))
+ self.logError(_("Error updating plugin %s") % filename, str(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), repr(e))
+ self.logDebug("Error deleting", path.basename(filename), str(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), repr(e))
+ self.logDebug("Error deleting", path.basename(filename), str(e))
err = True
if not err:
diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py
index c4d6e1b66..8a4e0e9d9 100644
--- a/module/plugins/hooks/XMPPInterface.py
+++ b/module/plugins/hooks/XMPPInterface.py
@@ -169,7 +169,7 @@ class XMPPInterface(IRCInterface, JabberClient):
messages.append(m)
except Exception, e:
- self.logError(repr(e))
+ self.logError(str(e))
return messages