diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-11-14 19:53:55 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-11-14 19:53:55 +0100 |
commit | 9d8d8db40662aeeb8ebbc5e6934d39f84574dd80 (patch) | |
tree | cff8ab2e9c20cd8a4b27b42b704c75377d343fd6 /module/plugins/internal/UnRar.py | |
parent | rehost,to timeout fix (diff) | |
download | pyload-9d8d8db40662aeeb8ebbc5e6934d39f84574dd80.tar.xz |
improved plugin loader, import hook to always use newest plugin versions
Diffstat (limited to 'module/plugins/internal/UnRar.py')
-rw-r--r-- | module/plugins/internal/UnRar.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 1943f69e0..feac4c176 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -23,8 +23,8 @@ from os.path import join from glob import glob from subprocess import Popen, PIPE -from module.plugins.hooks.ExtractArchive import AbtractExtractor from module.utils import save_join, decode +from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError class UnRar(AbtractExtractor): __name__ = "UnRar" @@ -95,7 +95,7 @@ class UnRar(AbtractExtractor): self.listContent() if not self.files: - self.m.archiveError("Empty Archive") + raise ArchiveError("Empty Archive") return False @@ -123,11 +123,11 @@ class UnRar(AbtractExtractor): progress(100) if "CRC failed" in err and not password and not self.passwordProtected: - self.m.crcError() + raise CRCError elif "CRC failed" in err: - self.m.wrongPassword() + raise WrongPassword if err.strip(): #raise error if anything is on stderr - self.m.archiveError(err.strip()) + raise ArchiveError(err.strip()) if not self.files: self.password = password @@ -145,7 +145,7 @@ class UnRar(AbtractExtractor): out, err = p.communicate() if "Cannot open" in err: - self.m.archiveError("Cannot open file") + raise ArchiveError("Cannot open file") if err.strip(): # only log error at this point self.m.logError(err.strip()) |