# HG changeset patch # User Frederic Bastien # Date 1297181644 18000 # Node ID 84cb96db56735c221a37799bcefb2eed0e813078 # Parent ea5d27727869d746840c5b96b1c341a86cdce320 return the first file in a file that exists in the directory in the PYLEARN_DATA_ROOT. diff -r ea5d27727869 -r 84cb96db5673 pylearn/datasets/config.py --- a/pylearn/datasets/config.py Mon Feb 07 17:04:56 2011 -0500 +++ b/pylearn/datasets/config.py Tue Feb 08 11:14:04 2011 -0500 @@ -51,11 +51,15 @@ return roots2 -def get_filepath_in_roots(name): +def get_filepath_in_roots(*names): """Return the full path of name that exist under a directory in the PYLEARN_DATA_ROOT env variable. + + If their is multiple file name, we return the first that exist. + This allow to get one of the file that is there. """ - for root in data_roots(): - path = os.path.join(root,name) - if os.path.exists(path): - return path + for name in names: + for root in data_roots(): + path = os.path.join(root,name) + if os.path.exists(path): + return path