bartender.walk_dir#

Classes#

DirectoryItem

An entry in a directory.

Functions#

walk_dir(→ DirectoryItem)

Traverse job dir returning the file names and directory names inside.

Module Contents#

class bartender.walk_dir.DirectoryItem#

Bases: pydantic.BaseModel

An entry in a directory.

name: str#
path: pathlib.Path#
is_dir: bool#
is_file: bool#
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:
Returns:

A tree of directory items.

Return type:

DirectoryItem