mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
debugging the config paths
This commit is contained in:
parent
0fa287c044
commit
280f656051
1 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue