ó V!¶\c@s“ddlZddlZddlmZejeƒZdefd„ƒYZdefd„ƒYZ defd„ƒYZ d efd „ƒYZ dS( iÿÿÿÿN(t get_callbackstTaskcBsŒeZdZd d d ed„Zd„Zed„ƒZd„Z d„Z d„Z d„Z d„Z d „Zd „Zd „Zd „ZRS(s­A task associated to a TransferFuture request This is a base class for other classes to subclass from. All subclassed classes must implement the main() method. cCs||_||_|jdkr-i|_n||_|dkrNi|_n||_|jdkrrg|_n||_dS(sŠ :type transfer_coordinator: s3transfer.futures.TransferCoordinator :param transfer_coordinator: The context associated to the TransferFuture for which this Task is associated with. :type main_kwargs: dict :param main_kwargs: The keyword args that can be immediately supplied to the _main() method of the task :type pending_main_kwargs: dict :param pending_main_kwargs: The keyword args that are depended upon by the result from a dependent future(s). The result returned by the future(s) will be used as the value for the keyword argument when _main() is called. The values for each key can be: * a single future - Once completed, its value will be the result of that single future * a list of futures - Once all of the futures complete, the value used will be a list of each completed future result value in order of when they were originally supplied. :type done_callbacks: list of callbacks :param done_callbacks: A list of callbacks to call once the task is done completing. Each callback will be called with no arguments and will be called no matter if the task succeeds or an exception is raised. :type is_final: boolean :param is_final: True, to indicate that this task is the final task for the TransferFuture request. By setting this value to True, it will set the result of the entire TransferFuture to the result returned by this task's main() method. N(t_transfer_coordinatort _main_kwargstNonet_pending_main_kwargst_done_callbackst _is_final(tselfttransfer_coordinatort main_kwargstpending_main_kwargstdone_callbackstis_final((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyt__init__s#        cCsMdddddddg}|j|j|ƒ}d|jj|jj|fS( Ntbuckettkeyt part_numbertfinal_filenamettransfer_futuretoffsett extra_argss%s(transfer_id=%s, %s)(t"_get_kwargs_with_params_to_includeRt __class__t__name__Rt transfer_id(Rtparams_to_displaytmain_kwargs_to_display((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyt__repr__Os cCs |jjS(s8The id for the transfer request that the task belongs to(RR(R((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyR\scCs8i}x+|D]#}||kr |||| :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The transfer future associated with the transfer request that tasks are being submitted for :param kwargs: Any additional kwargs that you may want to pass to the _submit() method tqueuedRN( Rtset_status_to_queuedRtset_status_to_runningt_submitt BaseExceptionR*t+_wait_for_all_submitted_futures_to_completeR+(RRRton_queued_callbackston_queued_callbackR,((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyR2és       cKstdƒ‚dS(sWThe submition method to be implemented :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The transfer future associated with the transfer request that tasks are being submitted for :param kwargs: Any additional keyword arguments you want to be passed in s_submit() must be implementedN(R;(RRR((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyRPs cCsL|jj}x9|rG|j|ƒ|jj}||kr>Pn|}qWdS(N(Rtassociated_futuresR@(Rtsubmitted_futurestpossibly_more_submitted_futures((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyRR$s     (RRHRIR2RPRR(((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyRLãs / tCreateMultipartUploadTaskcBseZdZd„ZRS(s#Task to initiate a multipart uploadcCsN|jd|d||}|d}|jj|jd|d|d|ƒ|S(sp :param client: The client to use when calling CreateMultipartUpload :param bucket: The name of the bucket to upload to :param key: The name of the key to upload to :param extra_args: A dictionary of any extra arguments that may be used in the intialization. :returns: The upload id of the multipart upload tBuckettKeytUploadId(tcreate_multipart_uploadRtadd_failure_cleanuptabort_multipart_upload(RtclientRRRtresponset upload_id((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyR2As   (RRHRIR2(((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyRX?stCompleteMultipartUploadTaskcBseZdZd„ZRS(s#Task to complete a multipart uploadc Cs0|jd|d|d|di|d6|dS(sz :param client: The client to use when calling CompleteMultipartUpload :param bucket: The name of the bucket to upload to :param key: The name of the key to upload to :param upload_id: The id of the upload :param parts: A list of parts to use to complete the multipart upload:: [{'Etag': etag_value, 'PartNumber': part_number}, ...] Each element in the list consists of a return value from ``UploadPartTask.main()``. :param extra_args: A dictionary of any extra arguments that may be used in completing the multipart transfer. RYRZR[tMultipartUploadtPartsN(tcomplete_multipart_upload(RR_RRRatpartsR((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyR2Zs  (RRHRIR2(((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyRbXs( RFtloggingts3transfer.utilsRt getLoggerRR0tobjectRRLRXRb(((s6/tmp/pip-install-usGedi/s3transfer/s3transfer/tasks.pyt s  Í\