__init___43.py 535 B

12345678910111213
  1. def _put_object(self, filename, bucket, key, callback, extra_args):
  2. # We're using open_file_chunk_reader so we can take advantage of the
  3. # progress callback functionality.
  4. open_chunk_reader = self._osutil.open_file_chunk_reader
  5. with open_chunk_reader(
  6. filename,
  7. 0,
  8. self._osutil.get_file_size(filename),
  9. callback=callback,
  10. ) as body:
  11. self._client.put_object(
  12. Bucket=bucket, Key=key, Body=body, **extra_args
  13. )