MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / files_from_glob_patterns

Function files_from_glob_patterns

cmd2/utils.py:347–360  ·  view source on GitHub ↗

Return a list of file paths based on a list of glob patterns. Only files are returned, not directories, and optionally only files for which the user has a specified access to. :param patterns: Iterable of file names and/or glob patterns :param access: file access type to verify (os.* w

(patterns: Iterable[str], access: int = os.F_OK)

Source from the content-addressed store, hash-verified

345
346
347def files_from_glob_patterns(patterns: Iterable[str], access: int = os.F_OK) -> list[str]:
348 """Return a list of file paths based on a list of glob patterns.
349
350 Only files are returned, not directories, and optionally only files for which the user has a specified access to.
351
352 :param patterns: Iterable of file names and/or glob patterns
353 :param access: file access type to verify (os.* where * is F_OK, R_OK, W_OK, or X_OK)
354 :return: list of files matching the names and/or glob patterns
355 """
356 files = []
357 for pattern in patterns:
358 matches = files_from_glob_pattern(pattern, access=access)
359 files.extend(matches)
360 return files
361
362
363def get_exes_in_path(starts_with: str) -> list[str]:

Callers

nothing calls this directly

Calls 1

files_from_glob_patternFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…