docs/api: add docstrings to {get_clan_details}

This commit is contained in:
Johannes Kirschbauer
2025-07-07 15:31:06 +02:00
parent 2bff7403df
commit 508cd3c784

View File

@@ -7,6 +7,14 @@ from clan_lib.persist.inventory_store import InventoryStore
@API.register @API.register
def get_clan_details(flake: Flake) -> InventoryMeta: def get_clan_details(flake: Flake) -> InventoryMeta:
"""Retrieve the clan details from the inventory of a given flake.
Args:
flake: The Flake instance representing the clan.
Returns:
InventoryMeta: The meta information from the clan's inventory.
Raises:
ClanError: If the flake does not exist, or if the inventory is invalid (missing the meta attribute).
"""
if flake.is_local and not flake.path.exists(): if flake.is_local and not flake.path.exists():
msg = f"Path {flake} does not exist" msg = f"Path {flake} does not exist"
raise ClanError(msg, description="clan directory does not exist") raise ClanError(msg, description="clan directory does not exist")