diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-22 18:24:15 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-22 18:24:15 +0200 |
commit | c2102ca45b5a03f8355363d14af00a0cee9c28e9 (patch) | |
tree | c24f5cb059028c1ec64d95fe268fd6de01c3213c | |
parent | unrar for win (diff) | |
download | pyload-c2102ca45b5a03f8355363d14af00a0cee9c28e9.tar.xz |
win compability
-rw-r--r-- | module/plugins/Plugin.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 987305d17..d197ec1a3 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -28,13 +28,15 @@ from random import randint import sys from os.path import exists +import os from os import remove from os import makedirs from os import chmod -from os import chown -from pwd import getpwnam -from grp import getgrnam +if os.name != "nt": + from os import chown + from pwd import getpwnam + from grp import getgrnam from mimetypes import guess_type @@ -277,7 +279,7 @@ class Plugin(object): if self.core.config["permission"]["change_file"]: chmod(join(location, name), int(self.core.config["permission"]["file"],8)) - if self.core.config["permission"]["change_user"] and self.core.config["permission"]["change_group"]: + if self.core.config["permission"]["change_user"] and self.core.config["permission"]["change_group"] and os.name != "nt": try: uid = getpwnam(self.config["permission"]["user"])[2] gid = getgrnam(self.config["permission"]["group"])[2] |