From 3e400279230f8f0ba3ebd8fa8689bd87f0bc4310 Mon Sep 17 00:00:00 2001 From: Marcus Stoegbauer Date: Mon, 14 Jan 2013 16:17:15 +0000 Subject: [PATCH] Replace $HOME in configdir with real home directory --- Userconfig/cfgfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userconfig/cfgfile.py b/Userconfig/cfgfile.py index de7f41c..82b86f1 100644 --- a/Userconfig/cfgfile.py +++ b/Userconfig/cfgfile.py @@ -11,6 +11,7 @@ Created by Marcus Stoegbauer on 2013-01-12. Copyright (c) 2013 __MyCompanyName__. All rights reserved. """ import ConfigParser +import os class Conf(object): confobj = ConfigParser.RawConfigParser() @@ -33,6 +34,9 @@ class Conf(object): raise Exception('Cannot read config file ' + filename) # if cannot read self.cfgfile = filename + + configdir=self.get("Main","configdir").replace("$HOME",os.environ['HOME']) + self.confobj.set("Main","configdir",configdir) # def setfilename def get(self, section, option):