MCPcopy
hub / github.com/pyinstaller/pyinstaller / ant_matcher

Function ant_matcher

bootloader/waflib/Node.py:42–63  ·  view source on GitHub ↗
(s, ignorecase)

Source from the content-addressed store, hash-verified

40
41
42def ant_matcher(s, ignorecase):
43 reflags = re.I if ignorecase else 0
44 ret = []
45 for x in Utils.to_list(s):
46 x = x.replace('\\', '/').replace('//', '/')
47 if x.endswith('/'):
48 x += '**'
49 accu = []
50 for k in x.split('/'):
51 if k == '**':
52 accu.append(k)
53 else:
54 k = k.replace('.', '[.]').replace('*', '.*').replace('?', '.').replace('+', '\\+')
55 k = '^%s$' % k
56 try:
57 exp = re.compile(k, flags=reflags)
58 except Exception as e:
59 raise Errors.WafError('Invalid pattern: %s' % k, e)
60 else:
61 accu.append(exp)
62 ret.append(accu)
63 return ret
64
65
66def ant_sub_filter(name, nn):

Callers 1

ant_globMethod · 0.85

Calls 3

to_listMethod · 0.80
appendMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…