summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/hooks/ExtractArchive.py10
-rw-r--r--module/plugins/internal/Captcha.py9
-rw-r--r--module/plugins/internal/Extractor.py9
-rw-r--r--module/plugins/internal/SevenZip.py14
-rw-r--r--module/plugins/internal/UnRar.py20
-rw-r--r--module/plugins/internal/UnZip.py4
6 files changed, 34 insertions, 32 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index ffcb6e738..98dea58ca 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -112,7 +112,7 @@ class ArchiveQueue(object):
class ExtractArchive(Addon):
__name__ = "ExtractArchive"
__type__ = "hook"
- __version__ = "1.47"
+ __version__ = "1.48"
__status__ = "testing"
__config__ = [("activated" , "bool" , "Activated" , True ),
@@ -490,13 +490,15 @@ class ExtractArchive(Addon):
send2trash.send2trash(file)
except NameError:
- self.log_warning(_("Unable to move %s to trash: Send2Trash lib not found") % os.path.basename(f))
+ self.log_warning(_("Unable to move %s to trash") % os.path.basename(f),
+ _("Send2Trash lib not found"))
except Exception, e:
- self.log_warning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message))
+ self.log_warning(_("Unable to move %s to trash") % os.path.basename(f),
+ e.message)
else:
- self.log_debug("Successfully moved %s to trash" % os.path.basename(f))
+ self.log_info(_("Moved %s to trash") % os.path.basename(f))
self.log_info(name, _("Extracting finished"))
extracted_files = archive.files or archive.list()
diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py
index dd2c7c762..92bcf9f84 100644
--- a/module/plugins/internal/Captcha.py
+++ b/module/plugins/internal/Captcha.py
@@ -12,7 +12,7 @@ from module.plugins.internal.Plugin import Plugin
class Captcha(Plugin):
__name__ = "Captcha"
__type__ = "captcha"
- __version__ = "0.36"
+ __version__ = "0.37"
__status__ = "testing"
__description__ = """Base anti-captcha plugin"""
@@ -37,7 +37,10 @@ class Captcha(Plugin):
def _log(self, level, plugintype, pluginname, messages):
- return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages)
+ return self.plugin._log(level,
+ plugintype,
+ "%s: %s" % (self.plugin.__name__, self.__name__),
+ messages)
def recognize(self, image):
@@ -107,7 +110,7 @@ class Captcha(Plugin):
self.fail(task.error)
elif not self.task.result:
- self.captcha.invalid()
+ self.invalid()
self.plugin.retry(reason=_("No captcha result obtained in appropiate time"))
result = self.task.result
diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py
index cbfae5a4d..907113a7e 100644
--- a/module/plugins/internal/Extractor.py
+++ b/module/plugins/internal/Extractor.py
@@ -22,7 +22,7 @@ class PasswordError(Exception):
class Extractor(Plugin):
__name__ = "Extractor"
__type__ = "extractor"
- __version__ = "0.28"
+ __version__ = "0.29"
__status__ = "testing"
__description__ = """Base extractor plugin"""
@@ -33,7 +33,7 @@ class Extractor(Plugin):
EXTENSIONS = []
REPAIR = False
- VERSION = ""
+ VERSION = None
@classmethod
@@ -114,7 +114,10 @@ class Extractor(Plugin):
def _log(self, level, plugintype, pluginname, messages):
- return self.plugin._log(level, plugintype, pluginname, (self.__name__,) + messages)
+ return self.plugin._log(level,
+ plugintype,
+ "%s: %s" % (self.plugin.__name__, self.__name__),
+ messages)
def check(self):
diff --git a/module/plugins/internal/SevenZip.py b/module/plugins/internal/SevenZip.py
index a5ccf2a26..5811c28de 100644
--- a/module/plugins/internal/SevenZip.py
+++ b/module/plugins/internal/SevenZip.py
@@ -10,7 +10,7 @@ from module.utils import fs_encode, save_join as fs_join
class SevenZip(UnRar):
__name__ = "SevenZip"
- __version__ = "0.13"
+ __version__ = "0.14"
__status__ = "testing"
__description__ = """7-Zip extractor plugin"""
@@ -19,9 +19,7 @@ class SevenZip(UnRar):
("Walter Purcaro", "vuolter@gmail.com")]
- CMD = "7z"
- VERSION = ""
-
+ CMD = "7z"
EXTENSIONS = [".7z", ".xz", ".zip", ".gz", ".gzip", ".tgz", ".bz2", ".bzip2",
".tbz2", ".tbz", ".tar", ".wim", ".swm", ".lzma", ".rar", ".cab",
".arj", ".z", ".taz", ".cpio", ".rpm", ".deb", ".lzh", ".lha",
@@ -50,11 +48,11 @@ class SevenZip(UnRar):
return False
else:
- return True
-
- finally:
m = cls.re_version.search(out)
- cls.VERSION = m.group(1) if m else '(version unknown)'
+ if m is not None:
+ cls.VERSION = m.group(1)
+
+ return True
def verify(self, password):
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index 30b763922..92128c77f 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -22,7 +22,7 @@ def renice(pid, value):
class UnRar(Extractor):
__name__ = "UnRar"
- __version__ = "1.23"
+ __version__ = "1.24"
__status__ = "testing"
__description__ = """Rar extractor plugin"""
@@ -32,11 +32,9 @@ class UnRar(Extractor):
("Immenz" , "immenz@gmx.net" )]
- CMD = "unrar"
- VERSION = ""
+ CMD = "unrar"
EXTENSIONS = [".rar"]
-
re_multipart = re.compile(r'\.(part|r)(\d+)(?:\.rar)?(\.rev|\.bad)?', re.I)
re_filefixed = re.compile(r'Building (.+)')
@@ -58,7 +56,7 @@ class UnRar(Extractor):
p = subprocess.Popen([cls.CMD], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
- cls.__name__ = "RAR"
+ # cls.__name__ = "RAR"
cls.REPAIR = True
except OSError:
@@ -74,12 +72,11 @@ class UnRar(Extractor):
except OSError:
return False
- else:
- return True
+ m = cls.re_version.search(out)
+ if m is not None:
+ cls.VERSION = m.group(1)
- finally:
- m = cls.re_version.search(out)
- cls.VERSION = m.group(1) if m else '(version unknown)'
+ return True
@classmethod
@@ -206,8 +203,7 @@ class UnRar(Extractor):
result.add(fs_join(self.out, os.path.basename(f)))
else:
for f in fs_decode(out).splitlines():
- f = f.strip()
- result.add(fs_join(self.out, f))
+ result.add(fs_join(self.out, f.strip()))
return list(result)
diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py
index aadc303aa..9a01611bf 100644
--- a/module/plugins/internal/UnZip.py
+++ b/module/plugins/internal/UnZip.py
@@ -12,7 +12,7 @@ from module.utils import fs_encode
class UnZip(Extractor):
__name__ = "UnZip"
- __version__ = "1.14"
+ __version__ = "1.15"
__status__ = "testing"
__description__ = """Zip extractor plugin"""
@@ -20,7 +20,7 @@ class UnZip(Extractor):
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- VERSION ="(python %s.%s.%s)" % (sys.version_info[0], sys.version_info[1], sys.version_info[2])
+ VERSION = "%s.%s.%s" % (sys.version_info[0], sys.version_info[1], sys.version_info[2])
EXTENSIONS = [".zip", ".zip64"]