diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-02-12 17:47:45 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-02-12 17:47:45 +0100 |
commit | 0336819d432c9dfdcee2c0cdae8b3aa597b4446b (patch) | |
tree | d6f25c850b0c0562ecb09d8b5ab953a29141a868 | |
parent | restored old width (diff) | |
download | pyload-0336819d432c9dfdcee2c0cdae8b3aa597b4446b.tar.xz |
closed #1
-rw-r--r-- | module/InitHomeDir.py | 18 | ||||
-rwxr-xr-x | pyload.py | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/module/InitHomeDir.py b/module/InitHomeDir.py index 14207847e..ccf525576 100644 --- a/module/InitHomeDir.py +++ b/module/InitHomeDir.py @@ -25,6 +25,7 @@ import sys from sys import argv, platform import __builtin__ + __builtin__.owd = path.abspath("") #original working directory __builtin__.pypath = path.abspath(path.join(__file__, "..", "..")) @@ -52,17 +53,14 @@ else: __builtin__.homedir = homedir +configdir = None args = " ".join(argv) - # dirty method to set configdir from commandline arguments if "--configdir=" in args: - pos = args.find("--configdir=") - end = args.find("-", pos + 12) + for arg in argv: + if arg.startswith("--configdir="): + configdir = arg.replace('--configdir=', '').strip() - if end == -1: - configdir = args[pos + 12:].strip() - else: - configdir = args[pos + 12:end].strip() elif "nosetests" in args: print "Running in test mode" configdir = join(pypath, "tests", "config") @@ -72,8 +70,10 @@ elif path.exists(path.join(pypath, "module", "config", "configdir")): c = f.read().strip() f.close() configdir = path.join(pypath, c) -else: - if platform in ("posix", "linux2"): + +# default config dir +if not configdir: + if platform in ("posix", "linux2", "darwin"): configdir = path.join(homedir, ".pyload") else: configdir = path.join(homedir, "pyload") @@ -180,7 +180,7 @@ class Core(object): print " -p, --pidfile=<file>", " " * 3, "Set pidfile to <file>" print " --changedir", " " * 12, "Change configuration directory permanently" print " --daemon", " " * 15, "Daemonize after startup" - print " --no-remote", " " * 12, "Disable remote access (saves RAM)" + print " --no-remote", " " * 12, "Disable remote access" print " --status", " " * 15, "Display pid if running or False" print " --clean", " " * 16, "Remove .pyc/.pyo files" print " -q, --quit", " " * 13, "Quit a running pyLoad instance" |