bartender.walk_dir#
Classes#
An entry in a directory. |
Functions#
|
Traverse job dir returning the file names and directory names inside. |
Module Contents#
- class bartender.walk_dir.DirectoryItem#
Bases:
pydantic.BaseModelAn entry in a directory.
- path: pathlib.Path#
- children: list[DirectoryItem] | None = None#
- async bartender.walk_dir.walk_dir(path: pathlib.Path | os.DirEntry[str], root: pathlib.Path, max_depth: int = 1) DirectoryItem#
Traverse job dir returning the file names and directory names inside.
- Parameters:
path (Union[pathlib.Path, os.DirEntry[str]]) – Path relative to root.
root (pathlib.Path) – The starting path.
max_depth (int) – Number of directories to traverse into.
- Returns:
A tree of directory items.
- Return type: