better handling of missing config files

This commit is contained in:
James Hensman 2013-11-13 13:40:44 +00:00
parent 280f656051
commit df97f7814e
2 changed files with 6 additions and 1 deletions

View file

@ -14,6 +14,9 @@ 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:
elif os.path.isfile(default_file):
# 2. if not, use the default one
config.read(default_file)
else:
#3. panic
raise ValueError, "no configuration file found"