mirror of https://github.com/ecmwf/eccodes.git
MEMFS: Ability to exclude a dir during walk
This commit is contained in:
parent
c7bd5c95db
commit
ca106c99ac
4
memfs.py
4
memfs.py
|
@ -30,9 +30,9 @@ for directory in dirs:
|
||||||
dname = os.path.basename(directory)
|
dname = os.path.basename(directory)
|
||||||
NAMES.append(dname)
|
NAMES.append(dname)
|
||||||
|
|
||||||
for dirname, _, files in os.walk(directory):
|
for dirpath, dirnames, files in os.walk(directory):
|
||||||
for name in files:
|
for name in files:
|
||||||
full = '%s/%s' % (dirname, name)
|
full = '%s/%s' % (dirpath, name)
|
||||||
_, ext = os.path.splitext(full)
|
_, ext = os.path.splitext(full)
|
||||||
if ext not in ['.def', '.table', '.tmpl']:
|
if ext not in ['.def', '.table', '.tmpl']:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue