MCPcopy Index your code
hub / github.com/RetiredWizard/PyDOS / _match

Function _match

PyDOS.py:41–59  ·  view source on GitHub ↗
(first, second)

Source from the content-addressed store, hash-verified

39
40# The first string may contain wildcards
41def _match(first, second):
42
43 # If we reach end of both strings, we are done
44 if len(first) == 0 and len(second) == 0:
45 return True
46
47 # Make sure that the characters after '*' are present
48 # in second string. Can't contain two consecutive '*'
49 if len(first) > 1 and first[0] == '*' and len(second) == 0:
50 return False
51
52 if (len(first) > 1 and first[0] == '?') or (len(first) != 0
53 and len(second) !=0 and first[0] == second[0]):
54 return _match(first[1:],second[1:])
55
56 if first[:1] == '*':
57 return _match(first[1:],second) or _match(first,second[1:])
58
59 return False
60
61def calcWildCardLen(wldCLen,recursiveFail):
62 wldCLen += 1

Callers 3

dirLoopFunction · 0.70
delFilesFunction · 0.70
PyDOSFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected