MCPcopy
hub / github.com/borgbackup/borg / push_back

Method push_back

src/borg/helpers/datastruct.py:103–120  ·  view source on GitHub ↗

Add data at the end of the queue. Chunks data into elements of size up to split_size.

(self, data)

Source from the content-addressed store, hash-verified

101 self.size -= to_remove
102
103 def push_back(self, data):
104 """
105 Add data at the end of the queue.
106 Chunks data into elements of size up to split_size.
107 """
108 if not self.buffers:
109 self.buffers = [self.member_type()]
110 while data:
111 buffer = self.buffers[-1]
112 if len(buffer) >= self.split_size:
113 buffer = self.member_type()
114 self.buffers.append(buffer)
115
116 to_add = min(len(data), self.split_size - len(buffer))
117 buffer += data[:to_add]
118 data = data[to_add:]
119 self.buffers[-1] = buffer
120 self.size += to_add
121
122 def __len__(self):
123 """

Callers 5

test_base_usageMethod · 0.95
test_chunkingMethod · 0.95
call_manyMethod · 0.80
call_manyMethod · 0.80

Calls

no outgoing calls

Tested by 3

test_base_usageMethod · 0.76
test_chunkingMethod · 0.76