MCPcopy Create free account
hub / github.com/docker/docker-py / fnmatchcase

Function fnmatchcase

docker/utils/fnmatch.py:47–60  ·  view source on GitHub ↗

Test whether FILENAME matches PATTERN, including case. This is a version of fnmatch() which doesn't case-normalize its arguments.

(name, pat)

Source from the content-addressed store, hash-verified

45
46
47def fnmatchcase(name, pat):
48 """Test whether FILENAME matches PATTERN, including case.
49 This is a version of fnmatch() which doesn't case-normalize
50 its arguments.
51 """
52
53 try:
54 re_pat = _cache[pat]
55 except KeyError:
56 res = translate(pat)
57 if len(_cache) >= _MAXCACHE:
58 _cache.clear()
59 _cache[pat] = re_pat = re.compile(res)
60 return re_pat.match(name) is not None
61
62
63def translate(pat):

Callers 1

fnmatchFunction · 0.85

Calls 2

translateFunction · 0.85
matchMethod · 0.80

Tested by

no test coverage detected