Current File : //proc/self/root/usr/lib/python3/dist-packages/s3transfer/__pycache__/tasks.cpython-312.pyc |
�
�<�e?? � � � d dl Z d dlZd dlmZ ej e� Z G d� d� Z G d� de� Z G d� de� Z G d � d
e� Z
y)� N)�
get_callbacksc �l � e Zd ZdZ dd�Zd� Zed� � Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� Zd� Zy)�Taskz�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.
Nc � � || _ || _ | j �i | _ || _ |�i | _ || _ | j �g | _ || _ y)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)�_transfer_coordinator�_main_kwargs�_pending_main_kwargs�_done_callbacks� _is_final)�self�transfer_coordinator�main_kwargs�pending_main_kwargs�done_callbacks�is_finals �2/usr/lib/python3/dist-packages/s3transfer/tasks.py�__init__z
Task.__init__ sb � �P &:��"�'������$� "�D��$7��!��&�(*�D�%�-������'�#%�D� �!��� c � � g d�}| j | j |� }dj | j j | j
j |� S )N)�bucket�key�part_number�final_filename�transfer_future�offset�
extra_argsz{}(transfer_id={}, {}))�"_get_kwargs_with_params_to_includer �format� __class__�__name__r �transfer_id)r �params_to_display�main_kwargs_to_displays r �__repr__z
Task.__repr__T s] � �
�� "&�!H�!H����0�"
�� (�.�.��N�N�#�#��&�&�2�2�"�
�
r c �. � | j j S )z8The id for the transfer request that the task belongs to)r r! )r s r r! zTask.transfer_idi s � � �)�)�5�5�5r c �2 � i }|D ] }||v s�|| ||<