Path
get_directories_with_file(paths, filename, leafs_only=False)
Find all directories in the given paths that contain a file with the specified filename.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
str | list[str] | None
|
List of paths. |
required |
filename
|
str
|
Name of the file to search for in the directories. |
required |
leafs_only
|
bool
|
If True, only return the leaf directories (i.e., those that are not parents of other directories in the list). |
False
|
Returns: List of directory paths where each directory contains the specified filename.
Source code in src/kibad_llm/utils/path.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |