list infos starting from after id . each info is a tuple (id, storage_size).
(self, limit=None, marker=None)
| 423 | return objs_errors == 0 or repair |
| 424 | |
| 425 | def list(self, limit=None, marker=None): |
| 426 | """ |
| 427 | list <limit> infos starting from after id <marker>. |
| 428 | each info is a tuple (id, storage_size). |
| 429 | """ |
| 430 | collect = True if marker is None else False |
| 431 | result = [] |
| 432 | infos = self.store.list("data") # generator yielding ItemInfos |
| 433 | while True: |
| 434 | self._lock_refresh() |
| 435 | try: |
| 436 | info = next(infos) |
| 437 | except StoreObjectNotFound: |
| 438 | break # can happen e.g. if "data" does not exist, pointless to continue in that case |
| 439 | except StopIteration: |
| 440 | break |
| 441 | else: |
| 442 | id = hex_to_bin(info.name) |
| 443 | if collect: |
| 444 | result.append((id, info.size)) |
| 445 | if len(result) == limit: |
| 446 | break |
| 447 | elif id == marker: |
| 448 | collect = True |
| 449 | # note: do not collect the marker id |
| 450 | return result |
| 451 | |
| 452 | def get(self, id, read_data=True, raise_missing=True): |
| 453 | self._lock_refresh() |
no test coverage detected