mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
better handling of missing config files
This commit is contained in:
parent
280f656051
commit
df97f7814e
2 changed files with 6 additions and 1 deletions
|
|
@ -14,6 +14,9 @@ print default_file, os.path.isfile(default_file)
|
||||||
# 1. check if the user has a ~/.gpy_config.cfg
|
# 1. check if the user has a ~/.gpy_config.cfg
|
||||||
if os.path.isfile(user_file):
|
if os.path.isfile(user_file):
|
||||||
config.read(user_file)
|
config.read(user_file)
|
||||||
else:
|
elif os.path.isfile(default_file):
|
||||||
# 2. if not, use the default one
|
# 2. if not, use the default one
|
||||||
config.read(default_file)
|
config.read(default_file)
|
||||||
|
else:
|
||||||
|
#3. panic
|
||||||
|
raise ValueError, "no configuration file found"
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,5 @@ include *.txt
|
||||||
recursive-include doc *.txt
|
recursive-include doc *.txt
|
||||||
include *.md
|
include *.md
|
||||||
recursive-include doc *.md
|
recursive-include doc *.md
|
||||||
|
include *.cfg
|
||||||
|
recursive-include doc *.cfg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue