MCPcopy Create free account
hub / github.com/cdgriffith/Box / _comment_repeat

Method _comment_repeat

box/box_list.py:320–328  ·  view source on GitHub ↗

Copy the comments of the first `length` items to repetitions `first`..`count` of them in `out`.

(self, out, count, length, first=0)

Source from the content-addressed store, hash-verified

318 self._comment_reindex(mapping)
319
320 def _comment_repeat(self, out, count, length, first=0):
321 """Copy the comments of the first `length` items to repetitions `first`..`count` of them in `out`."""
322 store = self.__dict__.get("_box_comments")
323 if store:
324 target = out._comment_store()
325 for repeat in range(first, max(count, 0)):
326 for index, comment in list(store.items()):
327 if index < length:
328 target[index + repeat * length] = copy.deepcopy(comment)
329
330 def _comment_owner(self, key):
331 """(container, index) that holds the comment for `key`, following box_dots paths."""

Callers 2

__mul__Method · 0.95
__imul__Method · 0.95

Calls 3

getMethod · 0.80
_comment_storeMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected