File: //usr/lib/python3/dist-packages/apt/progress/__pycache__/base.cpython-39.pyc
a
?��`W1 � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl
mZmZ ddl
Z
g d�ZG dd� de�ZG dd � d e�ZG d
d� de�ZG dd
� d
e�ZdS )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.
� )�print_functionN)�Optional�Union)�AcquireProgress�
CdromProgress�InstallProgress�
OpProgressc @ sp e Zd ZdZd Z Z Z ZZd Z Z
Zdd� Zdd� Z
dd � Zd
d� Zdd
� Zdd� Zdd� Zdd� ZdS )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 C s dS )z<Invoked when an item is successfully and completely fetched.N� ��self�itemr
r
�3/usr/lib/python3/dist-packages/apt/progress/base.py�done5 s zAcquireProgress.donec C s dS )z*Invoked when an item could not be fetched.Nr
r r
r
r �fail9 s zAcquireProgress.failc C s dS )z0Invoked when some of the item's data is fetched.Nr
r r
r
r �fetch= s zAcquireProgress.fetchc C s dS )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 r
r
r �ims_hitA s zAcquireProgress.ims_hitc C s dS )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 ZmediaZdriver
r
r �media_changeJ s zAcquireProgress.media_changec C s dS )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 �ownerr
r
r �pulseX s zAcquireProgress.pulsec C s4 d| _ d| _d| _d| _d| _d| _d| _d| _dS )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 r
r
r �starte s zAcquireProgress.startc C s dS )z/Invoked when the Acquire process stops running.Nr
r r
r
r �stopr s zAcquireProgress.stopN)�__name__�
__module__�__qualname__�__doc__r r r r r r r r r r r r r r r r r
r
r
r r * s �
r c @ s, e Zd ZdZdZdd� Zdd� Zdd� Zd S )
r a
Base class for reporting the progress of adding a cdrom.
Can be used with apt_pkg.Cdrom to produce an utility like apt-cdrom. The
attribute 'total_steps' defines the total number of steps and can be used
in update() to display the current progress.
r c C s dS )z�Ask for the name of the cdrom.
If a name has been provided, return it. Otherwise, return None to
cancel the operation.
Nr
r r
r
r �ask_cdrom_name� s zCdromProgress.ask_cdrom_namec C s dS )z�Ask for the CD-ROM to be changed.
Return True once the cdrom has been changed or False to cancel the
operation.
Nr
r r
r
r �change_cdrom� s zCdromProgress.change_cdromc C s dS )z�Periodically invoked to update the interface.
The string 'text' defines the text which should be displayed. The
integer 'current' defines the number of completed steps.
Nr
)r �text�currentr
r
r �update� s zCdromProgress.updateN)r! r"