MCPcopy Create free account
hub / github.com/aws/aws-cli / _wrap_data

Method _wrap_data

awscli/s3transfer/upload.py:487–510  ·  view source on GitHub ↗

Wraps data with the interrupt reader and the file chunk reader. :type data: bytes :param data: The data to wrap. :type callbacks: list :param callbacks: The callbacks associated with the transfer future. :type close_callbacks: list :param c

(self, data, callbacks, close_callbacks)

Source from the content-addressed store, hash-verified

485 return data
486
487 def _wrap_data(self, data, callbacks, close_callbacks):
488 """
489 Wraps data with the interrupt reader and the file chunk reader.
490
491 :type data: bytes
492 :param data: The data to wrap.
493
494 :type callbacks: list
495 :param callbacks: The callbacks associated with the transfer future.
496
497 :type close_callbacks: list
498 :param close_callbacks: The callbacks to be called when closing the
499 wrapper for the data.
500
501 :return: Fully wrapped data.
502 """
503 fileobj = self._wrap_fileobj(BytesIO(data))
504 return self._osutil.open_file_chunk_reader_from_fileobj(
505 fileobj=fileobj,
506 chunk_size=len(data),
507 full_file_size=len(data),
508 callbacks=callbacks,
509 close_callbacks=close_callbacks,
510 )
511
512
513class UploadSubmissionTask(SubmissionTask):

Callers 2

get_put_object_bodyMethod · 0.95

Calls 2

_wrap_fileobjMethod · 0.80

Tested by

no test coverage detected