def items(self, humanise: bool=True, precision: int=2) -> Iterator[dict]:
"""Returns an iterator for scanned items list. It doesn't return the
internal _items list because we don't want it to be modified outside.
Blocks until the scanning operation has been completed on first access.
:param humanise: Humanise flag to format results (defaults to True)
:type humanise: bool
:param precision: The floating precision of the human-readable size format (defaults to 2).
:type precision: int
:return: Iterator for the internal _items list.
:rtype: iterator
"""
self._await()
# Don't humanise
if humanise is False:
return iter(self._items)
# Humanise
humanise_item = partial(self._humanise_item, precision=precision)
return map(humanise_item, self._items)
评论列表
文章目录