Skip to content
Snippets Groups Projects
Commit 4cae06ae authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

bundle2: extract a _payloadchunks method for part

We are preparing streaming capability for part. So the generation of payload
chunk will becomes more complex. We extract this part in its own function before
any changes.
parent 1e28ec97
No related branches found
No related tags found
No related merge requests found
......@@ -549,6 +549,16 @@
yield _pack(_fpartheadersize, len(headerchunk))
yield headerchunk
## payload
for chunk in self._payloadchunks():
yield _pack(_fpayloadsize, len(chunk))
yield chunk
# end of payload
yield _pack(_fpayloadsize, 0)
def _payloadchunks(self):
"""yield chunks of a the part payload
Exists to handle the different methods to provide data to a part."""
# we only support fixed size data now.
# This will be improved in the future.
if len(self.data):
......@@ -552,5 +562,4 @@
# we only support fixed size data now.
# This will be improved in the future.
if len(self.data):
yield _pack(_fpayloadsize, len(self.data))
yield self.data
......@@ -556,6 +565,4 @@
yield self.data
# end of payload
yield _pack(_fpayloadsize, 0)
@parthandler('changegroup')
def handlechangegroup(op, inpart):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment