diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-15 16:51:28 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-15 16:51:28 +0200 |
commit | 975bcfe972f18026ac6c1e74711fa50a72295490 (patch) | |
tree | 9c178c3db1310a1d4341d8be309cc71a57392a76 /module/InitHomeDir.py | |
parent | some fixes, fixed #125 (diff) | |
download | pyload-975bcfe972f18026ac6c1e74711fa50a72295490.tar.xz |
permanent config dir change possible
Diffstat (limited to 'module/InitHomeDir.py')
-rw-r--r-- | module/InitHomeDir.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/module/InitHomeDir.py b/module/InitHomeDir.py index d7f98180a..7db0e7cbc 100644 --- a/module/InitHomeDir.py +++ b/module/InitHomeDir.py @@ -20,7 +20,7 @@ """ -from os import mkdir +from os import makedirs from os import path from os import chdir from sys import platform @@ -56,7 +56,12 @@ args = " ".join(argv[1:]) # dirty method to set configdir from commandline arguments -if "--configdir=" in args: +if path.exists(path.join(pypath, "module", "config", "configdir")): + f = open(path.join(pypath, "module", "config", "configdir"), "rb") + c = f.read().strip() + configdir = c + +elif "--configdir=" in args: pos = args.find("--configdir=") end = args.find("-", pos+12) @@ -71,7 +76,7 @@ else: configdir = path.join(homedir, "pyload") if not path.exists(configdir): - mkdir(configdir, 0700) + makedirs(configdir, 0700) __builtin__.configdir = configdir chdir(configdir) |