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

Method _comment_repeat

box/box_list.py:327–335  ·  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

325 self._comment_reindex(mapping)
326
327 def _comment_repeat(self, out, count, length, first=0):
328 """Copy the comments of the first `length` items to repetitions `first`..`count` of them in `out`."""
329 store = self.__dict__.get("_box_comments")
330 if store:
331 target = out._comment_store()
332 for repeat in range(first, max(count, 0)):
333 for index, comment in list(store.items()):
334 if index < length:
335 target[index + repeat * length] = copy.deepcopy(comment)
336
337 def _comment_owner(self, key):
338 """(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