File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/s3transfer/__pycache__/tasks.cpython-310.pyc
Back
o �h?? � @ sh d dl Z d dlZd dlmZ e�e�ZG dd� d�ZG dd� de�ZG dd� de�Z G d d � d e�Z dS )� N)� get_callbacksc @ s~ e Zd ZdZ ddd�Zdd� Zedd � �Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� ZdS )�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. NFc C sP || _ || _| jdu ri | _|| _|du ri | _|| _| jdu r#g | _|| _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)�_transfer_coordinator�_main_kwargs�_pending_main_kwargs�_done_callbacks� _is_final)�self�transfer_coordinator�main_kwargs�pending_main_kwargs�done_callbacks�is_final� r �F/usr/local/CyberPanel/lib/python3.10/site-packages/s3transfer/tasks.py�__init__ s ( z Task.__init__c C s, g d�}| � | j|�}d�| jj| jj|�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_displayr r r �__repr__T s ��z Task.__repr__c C s | j jS )z8The id for the transfer request that the task belongs to)r r )r r r r r i s zTask.transfer_idc C s&