summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/ExtractArchive.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-31 02:21:35 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-31 02:21:35 +0200
commit092112b44af84c7a59b1fa2cfff5c5875e778a8f (patch)
tree455f8192b0da79f3f325481a60feb239cc33d37d /module/plugins/hooks/ExtractArchive.py
parentFix https://github.com/pyload/pyload/issues/1624 (diff)
downloadpyload-092112b44af84c7a59b1fa2cfff5c5875e778a8f.tar.xz
Fix https://github.com/pyload/pyload/issues/1625
Diffstat (limited to 'module/plugins/hooks/ExtractArchive.py')
-rw-r--r--module/plugins/hooks/ExtractArchive.py26
1 files changed, 3 insertions, 23 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 62139ccc5..a71ec0e98 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -355,7 +355,9 @@ class ExtractArchive(Addon):
files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids \
if fname not in archive.get_delete_files()]
self.log_debug("Extracted files: %s" % new_files)
- self.set_permissions(new_files)
+
+ for file in new_files:
+ self.set_permissions(file)
for filename in new_files:
file = fs_encode(fs_join(os.path.dirname(archive.filename), filename))
@@ -584,25 +586,3 @@ class ExtractArchive(Addon):
except IOError, e:
self.log_error(e)
-
-
- def set_permissions(self, files):
- for f in files:
- if not os.path.exists(f):
- continue
-
- try:
- if self.pyload.config.get("permission", "change_file"):
- if os.path.isfile(f):
- os.chmod(f, int(self.pyload.config.get("permission", "file"), 8))
-
- elif os.path.isdir(f):
- os.chmod(f, int(self.pyload.config.get("permission", "folder"), 8))
-
- if self.pyload.config.get("permission", "change_dl") and os.name != "nt":
- uid = getpwnam(self.pyload.config.get("permission", "user"))[2]
- gid = getgrnam(self.pyload.config.get("permission", "group"))[2]
- os.chown(f, uid, gid)
-
- except Exception, e:
- self.log_warning(_("Setting User and Group failed"), e)