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

Function fnmatch

docker/utils/fnmatch.py:26–44  ·  view source on GitHub ↗

Test whether FILENAME matches PATTERN. Patterns are Unix shell style: * matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq An initial period in FILENAME is not special. Both FILENAME an

(name, pat)

Source from the content-addressed store, hash-verified

24
25
26def fnmatch(name, pat):
27 """Test whether FILENAME matches PATTERN.
28
29 Patterns are Unix shell style:
30
31 * matches everything
32 ? matches any single character
33 [seq] matches any character in seq
34 [!seq] matches any char not in seq
35
36 An initial period in FILENAME is not special.
37 Both FILENAME and PATTERN are first case-normalized
38 if the operating system requires it.
39 If you don't want this, use fnmatchcase(FILENAME, PATTERN).
40 """
41
42 name = name.lower()
43 pat = pat.lower()
44 return fnmatchcase(name, pat)
45
46
47def fnmatchcase(name, pat):

Callers 1

matchMethod · 0.90

Calls 1

fnmatchcaseFunction · 0.85

Tested by

no test coverage detected