Mercurial > hgrepos > Python > apps > py-cutils
changeset 305:6c212e407524
fnmatch: allow to supply another default when determining matches
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 05 Mar 2025 13:54:55 +0100 |
| parents | dc1f08937621 |
| children | ebddfdbc3f7a |
| files | cutils/util/fnmatch.py |
| diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/cutils/util/fnmatch.py Wed Mar 05 10:24:51 2025 +0100 +++ b/cutils/util/fnmatch.py Wed Mar 05 13:54:55 2025 +0100 @@ -117,8 +117,8 @@ matchers.append((action, kind, factory(pattern), pattern)) return klass(matchers) - def shall_visit(self, fn): - visit = self.VISIT_DEFAULT + def shall_visit(self, fn, default=None): + visit = default if default is not None else self.VISIT_DEFAULT for action, kind, matcher, orig_pattern in self._matchers: res = matcher(fn) if res:
