MCPcopy Create free account
hub / github.com/LabPy/lantz / normalize_excludes

Function normalize_excludes

docs/driversdoc.py:163–175  ·  view source on GitHub ↗

Normalize the excluded directory list: * must be either an absolute path or start with rootpath, * otherwise it is joined with rootpath * with trailing slash

(rootpath, excludes)

Source from the content-addressed store, hash-verified

161
162
163def normalize_excludes(rootpath, excludes):
164 """
165 Normalize the excluded directory list:
166 * must be either an absolute path or start with rootpath,
167 * otherwise it is joined with rootpath
168 * with trailing slash
169 """
170 f_excludes = []
171 for exclude in excludes:
172 if not path.isabs(exclude) and not exclude.startswith(rootpath):
173 exclude = path.join(rootpath, exclude)
174 f_excludes.append(path.normpath(exclude) + path.sep)
175 return f_excludes
176
177
178def is_excluded(root, excludes):

Callers 1

main2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected