Task to do a nonmultipart copy
| 315 | |
| 316 | |
| 317 | class CopyObjectTask(Task): |
| 318 | """Task to do a nonmultipart copy""" |
| 319 | |
| 320 | def _main( |
| 321 | self, client, copy_source, bucket, key, extra_args, callbacks, size |
| 322 | ): |
| 323 | """ |
| 324 | :param client: The client to use when calling PutObject |
| 325 | :param copy_source: The CopySource parameter to use |
| 326 | :param bucket: The name of the bucket to copy to |
| 327 | :param key: The name of the key to copy to |
| 328 | :param extra_args: A dictionary of any extra arguments that may be |
| 329 | used in the upload. |
| 330 | :param callbacks: List of callbacks to call after copy |
| 331 | :param size: The size of the transfer. This value is passed into |
| 332 | the callbacks |
| 333 | |
| 334 | """ |
| 335 | client.copy_object( |
| 336 | CopySource=copy_source, Bucket=bucket, Key=key, **extra_args |
| 337 | ) |
| 338 | for callback in callbacks: |
| 339 | callback(bytes_transferred=size) |
| 340 | |
| 341 | |
| 342 | class CopyPartTask(Task): |
no outgoing calls
no test coverage detected