execlib.util.path module¶
- execlib.util.path.get_running_path()[source]¶
Try to get the location of the current running script. If there are issues getting this, defaults to CWD.
- execlib.util.path.glob_match(filename, patterns)[source]¶
Convenience wrapper for wcmatch.glob.globmatch, with standard ** support. * won’t match across separators here, unlike fnmatch.fnmatch. Returns a boolean indicating if the filename matches at least one of the provided patterns.
- execlib.util.path.iter_glob_paths(_glob, path, no_dir=False, relative=False)[source]¶
wc_glob should ignore hidden files and directories by default; ** only matches non-hidden directories/files, * only non-hidden files.
- Note: Pattern quirks
Under wc_glob, ** (when GLOBSTAR enabled) will match all files and directories, recursively. Contrast this with Path.rglob(‘**’), which matches just directories. For wcmatch, use **/ to recover the directory-only behavior.
- Note: pattern behavior
*: all files and dirs, non-recursive
**: all files and dirs, recursive
*/: all dirs, non-recursive
**/: all dirs, recursive
All file (no dir) equivalents: either of the first two, with no_dir=True