debugging the config paths

This commit is contained in:
James Hensman 2013-11-13 13:34:10 +00:00
parent 0fa287c044
commit 280f656051

View file

@ -8,11 +8,12 @@ config = ConfigParser.ConfigParser()
home = os.getenv('HOME') or os.getenv('USERPROFILE')
user_file = os.path.join(home,'.gpy_config.cfg')
default_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'gpy_config.cfg'))
print user_file, os.path.isfile(user_file)
print default_file, os.path.isfile(default_file)
# 1. check if the user has a ~/.gpy_config.cfg
if os.path.isfile(user_file):
config.read(user_file)
else:
# 2. if not, use the default one
path = os.path.dirname(__file__)
config.read(os.path.join(path,default_file))
config.read(default_file)