diff options
author | Olivier <olivier-dev@gmx.com> | 2016-06-08 08:37:39 +0200 |
---|---|---|
committer | Olivier <olivier-dev@gmx.com> | 2016-06-08 08:37:39 +0200 |
commit | 8d550644b7547114327752aa840f032352a661f1 (patch) | |
tree | 11ad9aac48bd76b4ce6ec5a6487ea3c2f877f34b /module | |
parent | [ExtractArchive] Fix (diff) | |
download | pyload-8d550644b7547114327752aa840f032352a661f1.tar.xz |
[ExtractArchive] Maintain archive.files property
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/UnRar.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/UnTar.py | 7 | ||||
-rw-r--r-- | module/plugins/internal/UnZip.py | 5 |
3 files changed, 12 insertions, 6 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index b91f2455b..1d2e79d58 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -155,8 +155,7 @@ class UnRar(Extractor): if p.returncode: raise ArchiveError(_("Process return code: %d") % p.returncode) - self.files = self.list(password) - return self.files + return self.list(password) def chunks(self): @@ -195,7 +194,8 @@ class UnRar(Extractor): for f in decode(out).splitlines(): result.add(fsjoin(self.dest, f.strip())) - return list(result) + self.files = list(result) + return self.files def call_cmd(self, command, *xargs, **kwargs): diff --git a/module/plugins/internal/UnTar.py b/module/plugins/internal/UnTar.py index 7cc8516ae..4e498c223 100644 --- a/module/plugins/internal/UnTar.py +++ b/module/plugins/internal/UnTar.py @@ -38,7 +38,8 @@ class UnTar(Extractor): def list(self, password=None): with tarfile.open(self.target) as t: - return t.getnames() + self.files = t.getnames() + return self.files def verify(self, password=None): @@ -56,11 +57,13 @@ class UnTar(Extractor): def extract(self, password=None): - self.verify() + self.verify(password) try: with tarfile.open(self.target, errorlevel=2) as t: t.extractall(self.dest) + self.files = t.getnames() + return self.files except tarfile.ExtractError, e: self.log_warning(e) diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py index 50ab80da3..2870dc4eb 100644 --- a/module/plugins/internal/UnZip.py +++ b/module/plugins/internal/UnZip.py @@ -36,7 +36,8 @@ class UnZip(Extractor): def list(self, password=None): with zipfile.ZipFile(self.target, 'r') as z: z.setpassword(password) - return z.namelist() + self.files = z.namelist() + return self.files def verify(self, password=None): @@ -63,6 +64,8 @@ class UnZip(Extractor): with zipfile.ZipFile(self.target, 'r') as z: z.setpassword(password) z.extractall(self.dest) + self.files = z.namelist() + return self.files except RuntimeError, e: raise ArchiveError(e) |