
    ,                     >    S SK Jr  S SKJr  S SKJr   " S S\5      rg)    )six)accepts_kwargs)InvalidSubscriberMethodErrorc                   V   ^  \ rS rSrSr/ SQrU 4S jr\S 5       rS r	S r
S rS	rU =r$ )
BaseSubscriber   zThe 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                 J   > U R                  5         [        [        U ]  U 5      $ )N)_validate_subscriber_methodssuperr   __new__)clsargskwargs	__class__s      )lib/third_party/s3transfer/subscribers.pyr   BaseSubscriber.__new__   s!    ((*^S1#66    c                     U R                    HY  n[        U SU-   5      n[        R                  " U5      (       d  [	        SU-  5      e[        U5      (       a  MM  [	        SU-  5      e   g )Non_z&Subscriber method %s must be callable.z=Subscriber method %s must accept keyword arguments (**kwargs))VALID_SUBSCRIBER_TYPESgetattrr   callabler   r   )r   subscriber_typesubscriber_methods      r   r   +BaseSubscriber._validate_subscriber_methods#   sv    "99O 'U_-D E<< 1222<%&' ' ""3442+->?@ @  :r   c                     g)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_queuedBaseSubscriber.on_queued1        	r   c                     g)a  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_progressBaseSubscriber.on_progress@   s      	r   c                     g)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_doneBaseSubscriber.on_doneR   r&   r   r    )__name__
__module____qualname____firstlineno____doc__r   r   classmethodr   r$   r)   r,   __static_attributes____classcell__)r   s   @r   r   r      s?    
7 @ @$ r   r   N)botocore.compatr   s3transfer.compatr   s3transfer.exceptionsr   objectr   r    r   r   <module>r:      s      , >LV Lr   