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

Function is_excluded

docs/driversdoc.py:178–191  ·  view source on GitHub ↗

Check if the directory is in the exclude list. Note: by having trailing slashes, we avoid common prefix issues, like e.g. an exlude "foo" also accidentally excluding "foobar".

(root, excludes)

Source from the content-addressed store, hash-verified

176
177
178def is_excluded(root, excludes):
179 """
180 Check if the directory is in the exclude list.
181
182 Note: by having trailing slashes, we avoid common prefix issues, like
183 e.g. an exlude "foo" also accidentally excluding "foobar".
184 """
185 sep = path.sep
186 if not root.endswith(sep):
187 root += sep
188 for exclude in excludes:
189 if root.startswith(exclude):
190 return True
191 return False
192
193
194def main2(argv=sys.argv):

Callers 1

recurse_treeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected