From df97f7814efb0589868cfe9e6ef4026414fb5a83 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Wed, 13 Nov 2013 13:40:44 +0000 Subject: [PATCH] better handling of missing config files --- GPy/util/config.py | 5 ++++- MANIFEST.in | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/GPy/util/config.py b/GPy/util/config.py index cd29a8af..02796e0b 100644 --- a/GPy/util/config.py +++ b/GPy/util/config.py @@ -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" diff --git a/MANIFEST.in b/MANIFEST.in index c89284cd..8d5b2304 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,3 +2,5 @@ include *.txt recursive-include doc *.txt include *.md recursive-include doc *.md +include *.cfg +recursive-include doc *.cfg