summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-25 13:30:38 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-25 13:30:38 +0200
commit9a3aaaad1f569ca78bf4fcac8d107ed778f8639b (patch)
tree5a72aca46d448dc4c8306484d475a4e15b3b9aa6
parentremoved prints (diff)
downloadpyload-9a3aaaad1f569ca78bf4fcac8d107ed778f8639b.tar.xz
dir chown
-rw-r--r--module/ConfigParser.py2
-rw-r--r--module/plugins/Plugin.py9
-rwxr-xr-xmodule/web/run_server.py1
3 files changed, 11 insertions, 1 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index b8da9a32f..714e34ca9 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -76,7 +76,7 @@ class ConfigParser:
f = open("plugin.conf", "wb")
f.write("version: "+str(CONF_VERSION))
f.close()
- print "Old version of config was replaced"
+ print "Old version of plugin-config replaced"
except:
if n < 3:
sleep(0.3)
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index e7914c287..a12dfa686 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -267,6 +267,15 @@ class Plugin(object):
if not exists(location):
makedirs(location, int(self.core.config["permission"]["folder"],8))
+ if self.core.config["permission"]["change_dl"] and os.name != "nt":
+ try:
+ uid = getpwnam(self.config["permission"]["user"])[2]
+ gid = getgrnam(self.config["permission"]["group"])[2]
+
+ chown(location, uid, gid)
+ except Exception,e:
+ self.log.warning(_("Setting User and Group failed: %s") % str(e))
+
name = self.pyfile.name.encode(sys.getfilesystemencoding(), "replace")
newname = self.req.download(url, name, location, get, post, ref, cookies)
diff --git a/module/web/run_server.py b/module/web/run_server.py
index 34fca46c8..2dc97353a 100755
--- a/module/web/run_server.py
+++ b/module/web/run_server.py
@@ -54,6 +54,7 @@ def handle(* args):
try:
handler = AdminMediaHandler(WSGIHandler(), admin_media_path)
run(addr, int(port), handler)
+ #@TODO catch unimportant Broken Pipe Errors
except WSGIServerException, e:
# Use helpful error messages instead of ugly tracebacks.