fs.walk.Walker can take filter and exclude parameters to include/exclude certain file base names, as well as filter_dirs and exclude_dirs parameters to include/exclude entire directories.
My suggestion is to introduce two new parameters, filter_glob and exclude_glob, to work on arbitrary path objects. This would make working with filters mixed of both directories and files much easier.
For example, consider a file system with three files:
foo/a.py
foo/b.py
bar/a.py
Walking over all files except for foo/a.py is, afaik, impossible with the current Walker functionality. My suggestion would allow for:
fs.walk.Walker(filter_glob=["/"], exclude_glob=["/foo/a.py"])
fs.walk.Walkercan takefilterandexcludeparameters to include/exclude certain file base names, as well asfilter_dirsandexclude_dirsparameters to include/exclude entire directories.My suggestion is to introduce two new parameters,
filter_globandexclude_glob, to work on arbitrary path objects. This would make working with filters mixed of both directories and files much easier.For example, consider a file system with three files:
Walking over all files except for
foo/a.pyis, afaik, impossible with the currentWalkerfunctionality. My suggestion would allow for: