diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-24 15:48:08 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-24 15:48:08 +0100 |
commit | f71c1ef70a199e42e8a519364d9924e138ffd37c (patch) | |
tree | 56856f5a003cf344da9e37e94cf18e601ce9debd /module/plugins/hooks/ExtractArchive.py | |
parent | [BitshareCom] Code cosmetics (diff) | |
download | pyload-f71c1ef70a199e42e8a519364d9924e138ffd37c.tar.xz |
[ExtractArchive] Remove empty directory
Diffstat (limited to 'module/plugins/hooks/ExtractArchive.py')
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 11 |
1 files changed, 9 insertions, 2 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 |