diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-17 11:43:48 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-17 11:43:48 +0200 |
commit | 2d6cb8b4eb467d23373c5dd0e59ab90b7901b327 (patch) | |
tree | fea53a19005928b307c0ab38bae14e8417d66f9b | |
parent | missing icon (diff) | |
download | pyload-2d6cb8b4eb467d23373c5dd0e59ab90b7901b327.tar.xz |
change config path fix
-rw-r--r-- | module/InitHomeDir.py | 16 | ||||
-rw-r--r-- | module/PluginManager.py | 2 | ||||
-rw-r--r-- | module/config/default.conf | 2 | ||||
-rwxr-xr-x | pyLoadCore.py | 7 |
4 files changed, 13 insertions, 14 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) diff --git a/module/PluginManager.py b/module/PluginManager.py index fc144e8d5..afd527e40 100644 --- a/module/PluginManager.py +++ b/module/PluginManager.py @@ -132,7 +132,7 @@ class PluginManager(): version = 0 if home and home.has_key(name): - if home[name]["v"] > version: + if home[name]["v"] >= version: continue diff --git a/module/config/default.conf b/module/config/default.conf index eaa27f596..6b089d487 100644 --- a/module/config/default.conf +++ b/module/config/default.conf @@ -33,7 +33,7 @@ general - "General": ip download_interface : "Outgoing IP address for downloads" = None
permission - "Permissions":
bool change_user : "Change user of running process" = False
- str user : "Username" = "user"
+ str user : "Username" = user
str folder : "Folder Permission mode" = 0755
bool change_file : "Change file mode of downloads" = False
str file : "Filemode for Downloads" = 0644
diff --git a/pyLoadCore.py b/pyLoadCore.py index 12fcb3cff..e4bfbbb36 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -84,7 +84,7 @@ class Core(object): if len(argv) > 1: try: options, args = getopt(argv[1:], 'vca:hdus', - ["version", "clear", "add=", "help", "debug", "user", "setup", "configdir"]) + ["version", "clear", "add=", "help", "debug", "user", "setup", "configdir=", "changedir"]) for option, argument in options: if option in ("-v", "--version"): @@ -119,7 +119,7 @@ class Core(object): s = Setup(pypath, self.config) s.start() exit() - elif option == "--configdir": + elif option == "--changedir": from module.setup import Setup self.config = ConfigParser() @@ -144,7 +144,8 @@ class Core(object): print " -u, --user", " " * 13, "Set new User and password" print " -d, --debug", " " * 12, "Enable debug mode" print " -s, --setup", " " * 12, "Run Setup Assistent" - print " --configdir", " " * 12, "Set new config directory" + print " --configdir=<dir>", " " * 6, "Run with <dir> as config directory" + print " --changedir", " "* 12, "Change config dir permanently" print " -h, --help", " " * 13, "Display this help screen" print "" |