Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/s3transfer/__pycache__/tasks.cpython-37.pyc

127 lines
9.8 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>[<5B>]<5D>><00>@sjddlZddlZddlmZe<01>e<05>ZGdd<04>de<07>ZGdd<06>de<08>Z Gdd<08>de<08>Z
Gd d
<EFBFBD>d
e<08>Z dS) <0B>N)<01> get_callbacksc@sveZdZdZddd<05>Zdd<07>Zedd <09><00>Zd
d <0B>Zd d <0A>Z dd<0F>Z
dd<11>Z dd<13>Z dd<15>Z dd<17>Zdd<19>Zdd<1B>ZdS)<1D>Taskz<6B>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.
NFcCsP||_||_|jdkri|_||_|dkr0i|_||_|jdkrFg|_||_dS)a<>
: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)<05>_transfer_coordinator<6F> _main_kwargs<67>_pending_main_kwargs<67>_done_callbacks<6B> _is_final)<06>selfZtransfer_coordinatorZ main_kwargsZpending_main_kwargsZdone_callbacks<6B>is_final<61>r <00>8/tmp/pip-install-u_6_z2pz/s3transfer/s3transfer/tasks.py<70>__init__s#

z Task.__init__cCs6dddddddg}|<00>|j|<01>}d|jj|jj|fS) N<>bucket<65>keyZ part_numberZfinal_filename<6D>transfer_future<72>offset<65>
extra_argsz%s(transfer_id=%s, %s))<06>"_get_kwargs_with_params_to_includer<00> __class__<5F>__name__r<00> transfer_id)r Zparams_to_displayZmain_kwargs_to_displayr r r <00>__repr__Os

 z Task.__repr__cCs|jjS)z8The id for the transfer request that the task belongs to)rr)r r r r r\szTask.transfer_idcCs*i}x |D]}||kr
||||<q
W|S)Nr )r <00>kwargs<67>include<64>filtered_kwargs<67>paramr r r ras

z'Task._get_kwargs_with_params_to_includecCs0i}x&|<01><00>D]\}}||kr q|||<qW|S)N)<01>items)r r<00>excluderr<00>valuer r r <00>"_get_kwargs_with_params_to_excludehs  z'Task._get_kwargs_with_params_to_excludec
Cs<>zZy(|<00><00>|<00><01>}|j<02><03>s(|<00>|<01>SWn,tk
rV}z|<00>|<02>Wdd}~XYnXWdx|jD]
}|<03>qdW|jr<>|j<02> <09>XdS)z9The callable to use when submitting a Task to an executorN)
<EFBFBD>_wait_on_dependent_futures<65>_get_all_main_kwargsr<00>done<6E> _execute_main<69> Exception<6F>_log_and_set_exceptionrr<00> announce_done)r r<00>eZ done_callbackr r r <00>__call__ps
  
z Task.__call__cCsFdg}|<00>||<02>}t<01>d||f<00>|jf|<01>}|jrB|j<05>|<04>|S)N<>dataz Executing task %s with kwargs %s)r<00>logger<65>debug<75>_mainrrZ
set_result)r rZparams_to_excludeZkwargs_to_displayZ return_valuer r r r#<00>s  zTask._execute_maincCstjddd<03>|j<02>|<01>dS)NzException raised.T)<01>exc_info)r*r+rZ set_exception)r <00> exceptionr r r r%<00>szTask._log_and_set_exceptioncKs td<01><01>dS)z<>The method that will be ran in the executor
This method must be implemented by subclasses from Task. main() can
be implemented with any arguments decided upon by the subclass.
z_main() must be implementedN)<01>NotImplementedError)r rr r r r,<00>sz
Task._maincCsJg}x6|j<00><01>D](\}}t|t<03>r.|<01>|<03>q|<01>|<03>qW|<00>|<01>dS)N)rr<00>
isinstance<EFBFBD>list<73>extend<6E>append<6E>_wait_until_all_complete)r Zfutures_to_wait_on<6F>_<>futurer r r r <00>s 
 zTask._wait_on_dependent_futuresc Cs\t<00>d||<01>x<|D]4}yt<00>d||<02>|<02><02>Wqtk
rFYqXqWt<00>d|<00>dS)Nz-%s about to wait for the following futures %sz%s about to wait for %sz%%s done waiting for dependent futures)r*r+<00>resultr$)r Zfuturesr6r r r r4<00>s 

 
zTask._wait_until_all_completecCsdt<00>|j<01>}xR|j<02><03>D]D\}}t|t<05>rLg}x$|D]}|<04>|<05><07><00>q4Wn|<03><07>}|||<qW|S)N)<08>copyrrrr0r1r3r7)r rrZ pending_valuer7r6r r r r!<00>s 

 zTask._get_all_main_kwargs)NNNF)r<00>
__module__<EFBFBD> __qualname__<5F>__doc__r r<00>propertyrrrr(r#r%r,r r4r!r r r r rs
1  rc@s(eZdZdZdd<03>Zdd<05>Zdd<07>ZdS) <09>SubmissionTaskz<6B>A base class for any submission task
Submission tasks are the top-level task used to submit a series of tasks
to execute a particular transfer.
c
Ks<>yJ|j<00><01>t|d<01>}x|D]
}|<04>qW|j<00><03>|jfd|i|<02><02>Wn>tk
r<EFBFBD>}z |<00>|<05>|<00><07>|j<00><08>Wdd}~XYnXdS)a>
: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
ZqueuedrN) rZset_status_to_queuedrZset_status_to_running<6E>_submit<69> BaseExceptionr%<00>+_wait_for_all_submitted_futures_to_completer&)r rrZon_queued_callbacksZon_queued_callbackr'r r r r,<00>s 





zSubmissionTask._maincKs td<01><01>dS)aWThe 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
z_submit() must be implementedN)r/)r rrr r r r>s
zSubmissionTask._submitcCs6|jj}x(|r0|<00>|<01>|jj}||kr*P|}q
WdS)N)rZassociated_futuresr4)r Zsubmitted_futuresZpossibly_more_submitted_futuresr r r r@$s
z:SubmissionTask._wait_for_all_submitted_futures_to_completeN)rr9r:r;r,r>r@r r r r r=<00>s/ r=c@seZdZdZdd<03>ZdS)<05>CreateMultipartUploadTaskz#Task to initiate a multipart uploadcCs8|jf||d<01>|<04><02>}|d}|jj|j|||d<03>|S)ap
: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
)<02>Bucket<65>Key<65>UploadId)rBrCrD)Zcreate_multipart_uploadrZadd_failure_cleanupZabort_multipart_upload)r <00>clientrrr<00>response<73> upload_idr r r r,As zCreateMultipartUploadTask._mainN)rr9r:r;r,r r r r rA?srAc@seZdZdZdd<03>ZdS)<05>CompleteMultipartUploadTaskz#Task to complete a multipart uploadcCs"|jf|||d|id<02>|<06><02>dS)az
: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.
ZParts)rBrCrDZMultipartUploadN)Zcomplete_multipart_upload)r rErrrG<00>partsrr r r r,Zs
z!CompleteMultipartUploadTask._mainN)rr9r:r;r,r r r r rHXsrH) r8<00>loggingZs3transfer.utilsr<00> getLoggerrr*<00>objectrr=rArHr r r r <00><module> s 
N\