From 4f449a5e6e6ad5b394b05dfceaddf01ad58d8a2a Mon Sep 17 00:00:00 2001 From: Amir MOHAMMADI <amir.mohammadi@idiap.ch> Date: Mon, 13 Nov 2017 16:03:02 +0100 Subject: [PATCH] Allow for comment lines in file-lists --- bob/bio/base/database/filelist/models.py | 2 ++ bob/bio/base/test/data/example_filelist2/dev/for_models.lst | 3 +++ doc/filelist-guide.rst | 1 + 3 files changed, 6 insertions(+) diff --git a/bob/bio/base/database/filelist/models.py b/bob/bio/base/database/filelist/models.py index f5507f87..a6317136 100644 --- a/bob/bio/base/database/filelist/models.py +++ b/bob/bio/base/database/filelist/models.py @@ -87,6 +87,8 @@ class ListReader(object): raise RuntimeError('File %s does not exist.' % (list_file,)) try: for line in fileinput.input(list_file): + if line.strip().startswith('#'): + continue parsed_line = re.findall('[\w/(-.)]+', line) if len(parsed_line): # perform some sanity checks diff --git a/bob/bio/base/test/data/example_filelist2/dev/for_models.lst b/bob/bio/base/test/data/example_filelist2/dev/for_models.lst index 7bdbf751..c6618bb7 100644 --- a/bob/bio/base/test/data/example_filelist2/dev/for_models.lst +++ b/bob/bio/base/test/data/example_filelist2/dev/for_models.lst @@ -1,3 +1,6 @@ +# Model samples +#Modelsamples +#data/model3_session1_sample1 3 3 data/model3_session1_sample1 3 3 data/model3_session1_sample2 3 3 data/model3_session1_sample3 3 3 diff --git a/doc/filelist-guide.rst b/doc/filelist-guide.rst index 547ac797..eea61580 100644 --- a/doc/filelist-guide.rst +++ b/doc/filelist-guide.rst @@ -124,6 +124,7 @@ The following list files need to be created: filename client_id +Please note that in all files, the lines starting with ``#`` will be ignored. Protocols and File Lists -- GitLab