summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-24 15:48:08 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-24 15:48:08 +0100
commitf71c1ef70a199e42e8a519364d9924e138ffd37c (patch)
tree56856f5a003cf344da9e37e94cf18e601ce9debd /module/plugins
parent[BitshareCom] Code cosmetics (diff)
downloadpyload-f71c1ef70a199e42e8a519364d9924e138ffd37c.tar.xz
[ExtractArchive] Remove empty directory
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hooks/ExtractArchive.py11
-rw-r--r--module/plugins/internal/UnRar.py2
-rw-r--r--module/plugins/internal/UnZip.py2
3 files changed, 11 insertions, 4 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 16942bef0..8b3b4e310 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -58,7 +58,7 @@ from module.utils import save_join, uniqify
class ExtractArchive(Hook):
__name__ = "ExtractArchive"
__type__ = "hook"
- __version__ = "1.00"
+ __version__ = "1.01"
__config__ = [("activated" , "bool" , "Activated" , True ),
("fullpath" , "bool" , "Extract full path" , True ),
@@ -135,7 +135,7 @@ class ExtractArchive(Hook):
self.logInfo(_("Package %s queued for later extracting") % pypack.name)
self.queue.append(pid)
else:
- self.manager.startThread(self.extract, [pid])
+ self.extractPackage(pid)
@threaded
@@ -239,6 +239,7 @@ class ExtractArchive(Hook):
new_files = None
if new_files is None:
+ self.logWarning(basename(target), _("No files extracted"))
success = False
continue
@@ -264,6 +265,12 @@ class ExtractArchive(Hook):
else:
self.logInfo(_("No files found to extract"))
+ if not matched or not success and subfolder:
+ try:
+ os.rmdir(out)
+ except OSError:
+ pass
+
return True if not failed else False
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index 5633b31f7..b70bf3257 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -8,7 +8,7 @@ from os.path import basename, dirname, join
from string import digits
from subprocess import Popen, PIPE
-from module.plugins.internal.AbstractExtractor import AbtractExtractor, PasswordError, ArchiveError, CRCError
+from module.plugins.internal.AbstractExtractor import AbtractExtractor, ArchiveError, CRCError, PasswordError
from module.utils import save_join, decode
diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py
index b3d54cba0..875a0ec09 100644
--- a/module/plugins/internal/UnZip.py
+++ b/module/plugins/internal/UnZip.py
@@ -5,7 +5,7 @@ from __future__ import with_statement
import sys
import zipfile
-from module.plugins.internal.AbstractExtractor import AbtractExtractor, PasswordError, ArchiveError, CRCError
+from module.plugins.internal.AbstractExtractor import AbtractExtractor, ArchiveError, CRCError, PasswordError
class UnZip(AbtractExtractor):