docstrings

This commit is contained in:
Jörn-Michael Miehe 2023-10-26 19:20:46 +02:00
parent 246f8b8cac
commit f424ad25a4

View file

@ -34,6 +34,10 @@ class ListManager:
prefix: str, prefix: str,
names: list[str] = Depends(lister.func), names: list[str] = Depends(lister.func),
) -> list[str]: ) -> list[str]:
"""
Filters `names` from an async source for names starting with a given prefix.
"""
if isinstance(names, params.Depends): if isinstance(names, params.Depends):
names = await lister.func() names = await lister.func()
@ -45,6 +49,12 @@ class ListManager:
prefix: str, prefix: str,
names: list[str] = Depends(_filter_fn), names: list[str] = Depends(_filter_fn),
) -> str: ) -> str:
"""
Determines if a given prefix is unique in the async produced list `names`.
On success, produces the unique name with that prefix. Otherwise, throws a HTTPException.
"""
if isinstance(names, params.Depends): if isinstance(names, params.Depends):
names = await _filter_fn(prefix) names = await _filter_fn(prefix)