Ë
    ò`2f#  ã                   ó<   — d dl mZ d dlmZ d dlmZ  G d„ d«      Zy)é    )Ú	lru_cache)Úaccepts_kwargs)ÚInvalidSubscriberMethodErrorc                   ó`   ‡ — e Zd ZdZg d¢Zˆ fd„Ze e«       d„ «       «       Zd„ Z	d„ Z
d„ Zˆ xZS )ÚBaseSubscriberz¶The base subscriber class

    It is recommended that all subscriber implementations subclass and then
    override the subscription methods (i.e. on_{subsribe_type}() methods).
    )ÚqueuedÚprogressÚdonec                 óB   •— | j                  «        t        ‰| 	  | «      S )N)Ú_validate_subscriber_methodsÚsuperÚ__new__)ÚclsÚargsÚkwargsÚ	__class__s      €úV/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/s3transfer/subscribers.pyr   zBaseSubscriber.__new__   s   ø€ Ø×(Ñ(Ô*Ü‰w‰˜sÓ#Ð#ó    c                 ó¨   — | j                   D ]C  }t        | d|z   «      }t        |«      st        d|z  «      ‚t	        |«      rŒ7t        d|z  «      ‚ y )NÚon_z&Subscriber method %s must be callable.z=Subscriber method %s must accept keyword arguments (**kwargs))ÚVALID_SUBSCRIBER_TYPESÚgetattrÚcallabler   r   )r   Úsubscriber_typeÚsubscriber_methods      r   r   z+BaseSubscriber._validate_subscriber_methods    sq   € ð  #×9Ñ9ò 	ˆOÜ '¨¨U°_Ñ-DÓ EÐÜÐ-Ô.Ü2Ø<Ø'ñ(óð ô
 "Ð"3Õ4Ü2ð+Ø->ñ?óð ñ	r   c                  ó   — y)aù  Callback to be invoked when transfer request gets queued

        This callback can be useful for:

            * Keeping track of how many transfers have been requested
            * Providing the expected transfer size through
              future.meta.provide_transfer_size() so a HeadObject would not
              need to be made for copies and downloads.

        :type future: s3transfer.futures.TransferFuture
        :param future: The TransferFuture representing the requested transfer.
        N© ©ÚselfÚfuturer   s      r   Ú	on_queuedzBaseSubscriber.on_queued1   ó   € ð 	r   c                  ó   — y)aj  Callback to be invoked when progress is made on transfer

        This callback can be useful for:

            * Recording and displaying progress

        :type future: s3transfer.futures.TransferFuture
        :param future: The TransferFuture representing the requested transfer.

        :type bytes_transferred: int
        :param bytes_transferred: The number of bytes transferred for that
            invocation of the callback. Note that a negative amount can be
            provided, which usually indicates that an in-progress request
            needed to be retried and thus progress was rewound.
        Nr   )r   r    Úbytes_transferredr   s       r   Úon_progresszBaseSubscriber.on_progress@   s   € ð  	r   c                  ó   — y)aä  Callback to be invoked once a transfer is done

        This callback can be useful for:

            * Recording and displaying whether the transfer succeeded or
              failed using future.result()
            * Running some task after the transfer completed like changing
              the last modified time of a downloaded file.

        :type future: s3transfer.futures.TransferFuture
        :param future: The TransferFuture representing the requested transfer.
        Nr   r   s      r   Úon_donezBaseSubscriber.on_doneR   r"   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úclassmethodr   r   r!   r%   r'   Ú__classcell__)r   s   @r   r   r      sB   ø„ ñò <Ðô$ð Ùƒ[ñó ó ðòòö$r   r   N)Ú	functoolsr   Ús3transfer.compatr   Ús3transfer.exceptionsr   r   r   r   r   ú<module>r1      s   ðõ  å ,Ý >÷Lò Lr   