diff options
author | 2015-05-06 00:31:46 +0200 | |
---|---|---|
committer | 2015-05-06 00:31:46 +0200 | |
commit | 8d60ae2be14be54d4f4d4775fe696a82f84a000c (patch) | |
tree | 57e3da3c2ac9e18d04366c833259cee39635dc7b /pyload/plugin/addon/ExtractArchive.py | |
parent | Auto choose webserver (diff) | |
parent | [SimpleHoster] Fallback option (diff) | |
download | pyload-8d60ae2be14be54d4f4d4775fe696a82f84a000c.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
pyload/plugin/addon/AntiVirus.py
pyload/plugin/addon/ExtractArchive.py
pyload/plugin/hoster/GoogledriveCom.py
pyload/plugin/hoster/OneFichierCom.py
pyload/plugin/hoster/UlozTo.py
pyload/plugin/hoster/YadiSk.py
pyload/plugin/hoster/ZippyshareCom.py
pyload/plugin/internal/SimpleHoster.py
pyload/plugin/internal/XFSCrypter.py
pyload/plugin/internal/XFSHoster.py
Diffstat (limited to 'pyload/plugin/addon/ExtractArchive.py')
-rw-r--r-- | pyload/plugin/addon/ExtractArchive.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py index 71802cbfe..a2b22e90c 100644 --- a/pyload/plugin/addon/ExtractArchive.py +++ b/pyload/plugin/addon/ExtractArchive.py @@ -113,7 +113,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name = "ExtractArchive" __type = "addon" - __version = "1.42" + __version = "1.44" __config = [("activated" , "bool" , "Activated" , True), ("fullpath" , "bool" , "Extract with full paths" , True), @@ -188,6 +188,11 @@ class ExtractArchive(Addon): @threaded def extractQueued(self, thread): + if self.extracting: #@NOTE: doing the check here for safty (called by coreReady) + return + + self.extracting = True + packages = self.queue.get() while packages: if self.lastPackage: #: called from allDownloadsProcessed @@ -201,6 +206,8 @@ class ExtractArchive(Addon): packages = self.queue.get() #: check for packages added during extraction + self.extracting = False + @Expose def extractPackage(self, *ids): @@ -223,7 +230,7 @@ class ExtractArchive(Addon): def allDownloadsProcessed(self): self.lastPackage = True - if not self.extracting: + if self.getConfig('waitall') and not self.extracting: self.extractQueued() @@ -232,8 +239,6 @@ class ExtractArchive(Addon): if not ids: return False - self.extracting = True - processed = [] extracted = [] failed = [] @@ -375,7 +380,6 @@ class ExtractArchive(Addon): self.queue.remove(pid) - self.extracting = False return True if not failed else False @@ -473,8 +477,14 @@ class ExtractArchive(Addon): try: send2trash.send2trash(file) - except Exception: - self.logWarning(_("Unable to move %s to trash") % os.path.basename(f)) + except NameError: + self.logWarning(_("Unable to move %s to trash: Send2Trash lib not found") % os.path.basename(f)) + + except Exception, e: + self.logWarning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message)) + + else: + self.logDebug(_("Successfully moved %s to trash") % os.path.basename(f)) self.logInfo(name, _("Extracting finished")) extracted_files = archive.files or archive.list() |