summaryrefslogtreecommitdiffstats
path: root/module/InitHomeDir.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/InitHomeDir.py')
-rw-r--r--module/InitHomeDir.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/module/InitHomeDir.py b/module/InitHomeDir.py
index 0c66b5c32..8515310ef 100644
--- a/module/InitHomeDir.py
+++ b/module/InitHomeDir.py
@@ -55,26 +55,24 @@ __builtin__.homedir = homedir
args = " ".join(argv[1:])
# dirty method to set configdir from commandline arguments
-
-if path.exists(path.join(pypath, "module", "config", "configdir")):
- f = open(path.join(pypath, "module", "config", "configdir"), "rb")
- c = f.read().strip()
- configdir = path.join(pypath, c)
-
-elif "--configdir=" in args:
+if "--configdir=" in args:
pos = args.find("--configdir=")
end = args.find("-", pos+12)
-
+
if end == -1:
configdir = args[pos+12:].strip()
else:
configdir = args[pos+12:end].strip()
+elif path.exists(path.join(pypath, "module", "config", "configdir")):
+ f = open(path.join(pypath, "module", "config", "configdir"), "rb")
+ c = f.read().strip()
+ configdir = path.join(pypath, c)
else:
if platform in ("posix","linux2"):
configdir = path.join(homedir, ".pyload")
else:
configdir = path.join(homedir, "pyload")
-
+
if not path.exists(configdir):
makedirs(configdir, 0700)