%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/apt/progress/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/apt/progress/__pycache__/text.cpython-312.pyc

�

\�e"(���dZddlZddlZddlZddlZddlZddlmZddlZddl	m
Z
gd�Zdedefd�Z
Gd	�d
�ZGd�de
je�ZGd
�de
j e�ZGd�de
j"e�Zy)z'Progress reporting for text interfaces.�N)�Callable)�base)�AcquireProgress�
CdromProgress�
OpProgress�msg�returnc�f�tj|�}||k(rtj|d�}|S)z>Translate the message, also try apt if translation is missing.�apt)�apt_pkg�gettext)r�ress  �3/usr/lib/python3/dist-packages/apt/progress/text.py�_r s,��
�/�/�#�
�C�
�c�z��o�o�c�5�)���J�c	�V�eZdZdZd
dej
dzddfd�Zddedededdfd	�Z	y)�TextProgressz.Internal Base class for text progress classes.N�outfiler	c�D�|xstj|_d|_y)Nr)�sys�stdout�_file�_width��selfrs  r�__init__zTextProgress.__init__+s���*��
�
��
���rr�newline�maximizec���|jjd�|jj|�|jt|�kDr5|jj|jt|�z
dz�n&|r$t	|jt|��|_|r|jjd�y|jj�y)z8Write the message on the terminal, fill remaining space.�
� �
N)r�writer�len�max�flush)rrrrs    r�_writezTextProgress._write/s����
�
������
�
������;�;��S��!��J�J���d�k�k�C��H�4��;�<�
��d�k�k�3�s�8�4�D�K���J�J���T�"�
�J�J���r�N)TF)
�__name__�
__module__�__qualname__�__doc__�io�
TextIOBaser�str�boolr'�rrrr(sC��8���
�
�� 4�����#����t��PT�rrc�\�eZdZdZd	dej
dzddfd�Zd	dedzddfd�Zd
d�Z	y)rz\Operation progress reporting.

    This closely resembles OpTextProgress in libapt-pkg.
    Nrr	c�|�tj||�tjj|�d|_y)N�)rrrr�old_oprs  rrzOpProgress.__init__Fs+�����d�G�,���� � ��&���r�percentc�$�tjj||�|jr'|jr|j|j�|jd|j|jfzdd�|j|_y)z1Called periodically to update the user interface.z%s... %i%%
FTN)rr�update�major_changer5r'�opr6)rr6s  rr8zOpProgress.updateKsb�������t�W�-��������K�K����$����N�d�g�g�t�|�|�%<�<�e�T�J��g�g��rc��tjj|�|jr+|j	td�d|jfzdd�d|_y)z,Called once an operation has been completed.z%c%s... Doner Tr4N)rr�doner5r'r�rs rr<zOpProgress.doneSsE�������T�"��;�;��K�K��.�)�T�4�;�;�,?�?��t�L���rr(�r	N)
r)r*r+r,r-r.r�floatr8r<r1rrrr@s?���
��
�
�� 4����
�e�d�l��d��rrc��eZdZdZddej
dzddfd�Zdd�Zdeddfd�Z	d	e
jddfd
�Zd	e
jddfd�Z
d	e
jddfd�Zd
e
jdefd�Zdededefd�Zdd�Zy)rz'AcquireProgress for the text interface.Nrr	c��tj||�tjj|�d|_d|_d|_y)N�P�)rrrr�_signalr�_idrs  rrzAcquireProgress.__init__^sB�����d�G�,����%�%�d�+�
�	
�������rc���tjj|�tjtj|j
�|_|j�d|_y)z�Start an Acquire progress.

        In this case, the function sets up a signal handler for SIGWINCH, i.e.
        window resize signals. And it also sets id to 1.
        rCN)rr�start�signal�SIGWINCH�_winchrDrEr=s rrGzAcquireProgress.startgsB��	
���"�"�4�(��}�}�V�_�_�d�k�k�B������
���r�dummyc�6�t|jd�r�tj|jj	��rUddl}ddl}ddl}|j|j|jd�}|jd|�\}}}}|dz
|_yyy)z)Signal handler for window resize signals.�filenorNs        �hhhhrC)�hasattrr�os�isattyrM�fcntl�struct�termios�ioctl�
TIOCGWINSZ�unpackr)rrKrRrSrT�buf�cols       rrJzAcquireProgress._winchssz���4�:�:�x�(�R�Y�Y�t�z�z�7H�7H�7J�-K�����+�+�d�j�j�'�*<�*<�h�G�C�'-�}�}�V�S�'A�$�E�3��u���'�D�K�.L�(r�itemc� �tjj||�td�|jz}|j
jr/|dtj|j
j�zz
}|j|�y)z@Called when an item is update (e.g. not modified on the server).zHit � [%sB]N)
rr�ims_hitr�description�owner�filesizer�size_to_strr'�rrZ�lines   rr]zAcquireProgress.ims_hit~si�����$�$�T�4�0���y�4�+�+�+���:�:����H�w�2�2�4�:�:�3F�3F�G�G�G�D����D�rc��tjj||�|jj|jj
k(r(|j
td�|jz�y|j
td�|jz�|j
d|jjz�y)zCalled when an item is failed.zIgn zErr z  %sN)
rr�failr_�status�	STAT_DONEr'rr^�
error_text)rrZs  rrezAcquireProgress.fail�s������!�!�$��-��:�:����
�
� 4� 4�4��K�K��&�	�D�$4�$4�4�5��K�K��&�	�D�$4�$4�4�5��K�K�����!6�!6�6�7rc���tjj||�|jjry|j
|j_|xj
dz
c_td�|jj�d|j��z}|jjr/|dtj|jj�zz
}|j|�y)z/Called when some of the item's data is fetched.NrCzGet:r!r\)
rr�fetchr_�completerE�idrr^r`rrar'rbs   rrjzAcquireProgress.fetch�s������"�"�4��.��:�:��������
�
�
����A�
����y�d�j�j�m�m�_�A�d�.>�.>�-?�@�@���:�:����H�w�2�2�4�:�:�3F�3F�G�G�G�D����D�rr_c�*�tjj||�t|jd�r.tj|jj��sy|j|jzdzt|j|jz�z}d}d|z}d}|jrztt|j|jz
�|jz�}djt!j"|j�t!j$|��}|j&D�]�}d}|j(sV|j*rId|j*z}t-|�t-|�zt-|�z|j.k\r�n�||z
}d}�hd}|j(j0j2r=|d	|j(j0j2|j(j4fzz
}n|d
|j(j6zz
}|j(j0j8r&|d|j(j0j8zz
}|dt!j"|j:�zz
}|j<ra|j(j0j>sA|d
t!j"|j<�|j:dz|j<zfzz
}|dz
}t-|�t-|�zt-|�z|j.k\rn||z
}���|s|tAd�z
}|jr-||j.t-|�z
t-|�z
dz|zz
}|jC|d�y)z�Periodically invoked while the Acquire process is underway.

        Return False if the user asked to cancel the whole Acquire process.rMTgY@Fz%i%%r4z	 {}B/s {}z [%s]z [%i %sz [%sz %sz %sBz	/%sB %i%%�]z
 [Working]r!)"rr�pulserOrrPrQrM�
current_bytes�
current_itemsr?�total_bytes�total_items�current_cps�int�formatrra�time_to_str�workers�current_itemrfr$rr_rl�	shortdescr^�active_subprocess�current_size�
total_sizerkrr')	rr_r6�shown�tval�end�eta�worker�vals	         rrozAcquireProgress.pulse�s&��	
���"�"�4��/��4�:�:�x�(����4�:�:�;L�;L�;N�1O���&�&��);�);�;�u�D�����t�/�/�/�I
�
��������������e�D�,�,�t�/A�/A�A�B�T�EU�EU�U�V�C��$�$��#�#�D�$4�$4�5��#�#�C�(��C�
�m�m�%	�F��C��&�&��=�=�!�F�M�M�1�C��4�y�3�s�8�+�c�#�h�6�$�+�+�E���C�K�D� �E���E��"�"�(�(�+�+��y��'�'�-�-�0�0��'�'�1�1�$����
�v�� 3� 3� ?� ?�?�?���"�"�(�(�:�:��u�v�2�2�8�8�J�J�J�J���6�G�/�/��0C�0C�D�D�D�C�� � ��)<�)<�)B�)B�)K�)K��{��'�'��(9�(9�:��'�'�%�/�&�2C�2C�C�&����

�3�J�C��4�y�3�s�8�#�c�#�h�.�$�+�+�=������K%	�N��A�l�O�#�D�����T�[�[�3�s�8�+�c�$�i�7�3�>��D�D�D����D�%� �r�medium�drivec��tjj|||�|jt	d�||fz�t�dvS)z7Prompt the user to change the inserted removable media.zUMedia change: please insert the disc labeled
 '%s'
in the drive '%s' and press enter
)�c�C)rr�media_changer'r�input)rr�r�s   rr�zAcquireProgress.media_change�sP�����)�)�$���>����
�6�
�
�u�o�
�	
��w�j�(�(rc��tjj|�|jt	d�tj|j�tj|j�tj|j�fzjd��ddl}|j|j|j�y)z/Invoked when the Acquire process stops running.zFetched %sB in %s (%sB/s)
r"rN)rr�stopr'rrra�
fetched_bytesrw�elapsed_timert�rstriprHrIrD)rrHs  rr�zAcquireProgress.stop�s������!�!�$�'�����/�0��'�'��(:�(:�;��'�'��(9�(9�:��'�'��(8�(8�9����f�T�l�		
�	���
�
�f�o�o�t�|�|�4rr(r>)r)r*r+r,r-r.rrG�objectrJr�AcquireItemDescr]rerj�Acquirer0ror/r�r�r1rrrr[s���1���
�
�� 4����
�	"�V�	"��	"��G�3�3����8��0�0�8�T�8��'�1�1��d��F�7�?�?�F�t�F�P)�3�)�s�)�t�)�5rrc�B�eZdZdZdedzfd�Zdededdfd�Zdefd�Z	y)	rzText CD-ROM progress.r	Nc��tjj|�|jt	d�d�	tt
d��S#t$rYywxYw)z,Ask the user to provide a name for the disc.zDPlease provide a name for this medium, such as 'Debian 2.1r1 Disk 1'F�:N)rr�ask_cdrom_namer'rr/r��KeyboardInterruptr=s rr�zCdromProgress.ask_cdrom_name
sY�����)�)�$�/����
�(�
�
�	
�	��u�S�z�?�"�� �	��	�s�A�	A�A�text�currentc�p�tjj|||�|r|j|d�yy)zSet the current progress.FN)rrr8r')rr�r�s   rr8zCdromProgress.updates0�����!�!�$��g�6���K�K��e�$�rc���tjj|�|jt	d�d�	tt
�dk(�S#t$rYywxYw)z"Ask the user to change the CD-ROM.z4Please insert an installation medium and press enterFr4)rr�change_cdromr'rr0r�r�r=s rr�zCdromProgress.change_cdromsR�����'�'��-����A�L�M�u�U�	����2�
�&�&�� �	��	�s�A�	A�A)
r)r*r+r,r/r�rur8r0r�r1rrrrs;���
��d�
�
�%�3�%��%��%��d�rr)r,r-rPrHr�types�collections.abcrr�apt.progressr�__all__r/rrrrrr1rr�<module>r�s���".�	�	�
�
��$���
<���3��3����0����,��6i5�d�*�*�L�i5�X�D�&�&��r

Zerion Mini Shell 1.0