summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/addon/ExtractArchive.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/addon/ExtractArchive.py')
-rw-r--r--pyload/plugin/addon/ExtractArchive.py24
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()