From 2d6cb8b4eb467d23373c5dd0e59ab90b7901b327 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 17 Sep 2010 11:43:48 +0200 Subject: change config path fix --- module/InitHomeDir.py | 16 +++++++--------- module/PluginManager.py | 2 +- module/config/default.conf | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'module') 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 -- cgit v1.2.3