�
\�e�/ � � � d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl
Z
g d�Z G d� d� Z G d� d� Z
G d � d
� Z G d� d� Zy)
z�Base classes for progress reporting.
Custom progress classes should inherit from these classes. They can also be
used as dummy progress classes which simply do nothing.
� )�annotationsN)�AcquireProgress�
CdromProgress�InstallProgress�
OpProgressc �p � e Zd ZdZdxZxZxZxZZdxZ xZ
Zd
d�Zd
d�Z
d
d�Zd
d�Zdd�Zdd �Zdd
�Zdd�Zy)r z�Monitor object for downloads controlled by the Acquire class.
This is an mostly abstract class. You should subclass it and implement the
methods to get something useful.
� r c � � y)z<Invoked when an item is successfully and completely fetched.N� ��self�items �3/usr/lib/python3/dist-packages/apt/progress/base.py�donezAcquireProgress.done2 � � � c � � y)z*Invoked when an item could not be fetched.Nr r s r �failzAcquireProgress.fail5 r r c � � y)z0Invoked when some of the item's data is fetched.Nr r s r �fetchzAcquireProgress.fetch8 r r c � � y)z�Invoked when an item is confirmed to be up-to-date.
Invoked when an item is confirmed to be up-to-date. For instance,
when an HTTP download is informed that the file on the server was
not modified.
Nr r s r �ims_hitzAcquireProgress.ims_hit; r r c � � y)a� Prompt the user to change the inserted removable media.
The parameter 'media' decribes the name of the media type that
should be changed, whereas the parameter 'drive' should be the
identifying name of the drive whose media should be changed.
This method should not return until the user has confirmed to the user
interface that the media change is complete. It must return True if
the user confirms the media change, or False to cancel it.
Fr )r
�media�drives r �media_changezAcquireProgress.media_changeC s � � r c � � y)a Periodically invoked while the Acquire process is underway.
This method gets invoked while the Acquire progress given by the
parameter 'owner' is underway. It should display information about
the current state.
This function returns a boolean value indicating whether the
acquisition should be continued (True) or cancelled (False).
Tr )r
�owners r �pulsezAcquireProgress.pulseP s � � r c �t � d| _ d| _ d| _ d| _ d| _ d| _ d| _ d| _ y)z0Invoked when the Acquire process starts running.r r N)�
current_bytes�current_cps�
current_items�elapsed_time�
fetched_bytes�
last_bytes�total_bytes�total_items�r
s r �startzAcquireProgress.start\ sC � � !������������ �����������r c � � y)z/Invoked when the Acquire process stops running.Nr r) s r �stopzAcquireProgress.stoph r r N)r zapt_pkg.AcquireItemDesc�return�None)r �strr r/ r- �bool)r zapt_pkg.Acquirer- r0 �r- r. )�__name__�
__module__�__qualname__�__doc__r! r" |