From e8e757b6802546c575727336cd2c52196948d1d4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 16 Mar 2018 16:47:07 +0000 Subject: [PATCH] MEMFS: Print message re exclusion --- memfs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/memfs.py b/memfs.py index 2238a5256..c07e4965c 100755 --- a/memfs.py +++ b/memfs.py @@ -7,6 +7,9 @@ import binascii assert len(sys.argv) > 2 +# For now exclude GRIB3 as it is still experimental +EXCLUDED = 'grib3' + dirs = [os.path.realpath(x) for x in sys.argv[1:-1]] print(dirs) @@ -31,8 +34,11 @@ for directory in dirs: NAMES.append(dname) for dirpath, dirnames, files in os.walk(directory): - # For now exclude GRIB3 as it is still experimental - dirnames[:] = [dirname for dirname in dirnames if dirname != 'grib3'] + if EXCLUDED in dirnames: + print('Note: %s/%s will not be included.' % (dirpath,EXCLUDED)) + + # Prune the walk by modifying the dirnames in-place + dirnames[:] = [dirname for dirname in dirnames if dirname != EXCLUDED] for name in files: full = '%s/%s' % (dirpath, name) _, ext = os.path.splitext(full)