https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/progress.cpython-310.pyc
o

�]Lb�+�@spddlmZddlZddlZddlZddlmZddlmZdd�Z	dd	�Z
d
d�Zdd
�ZGdd�de
�ZdS)�)�absolute_importN���_)�encodingcGsd�dd�|D��S)N� css�|]}|r|VqdS�N�)�.0�sr	r	�4/usr/lib/python3/dist-packages/mercurial/progress.py�	<genexpr>s�zspacejoin.<locals>.<genexpr>)�join)�argsr	r	r�	spacejoin�rcCs*|jp|�d�o|�|j�p|�dd�S)N�progresss
assume-tty)�quiet�plain�_isatty�ferr�
configbool)�uir	r	r�shouldprints�rcCs|dkr
td�|S|d}|dkr ||d8}td�||fS|d7}|d}||d8}|dkr:td�||fS|d7}|d}||d8}|dkrTtd	�||fS|d7}|d
}||d
8}|dkrntd�||fS|d7}|d
}||d
8}td�||fS)z�format a number of remaining seconds in human readable way

    This will properly display seconds, minutes, hours, days if needed�<s%02dss%dm%02dsr�s%dh%02dm��s%dd%02dh��7s%dw%02dd�4s%dy%02dwr)�seconds�minutes�hours�days�weeks�yearsr	r	r�fmtremainings2r'c
Gs@	z||�WSty}z
|jtjkrWYd}~q�d}~wwr)�IOError�errno�EINTR)�funcr�errr	r	r�_eintrretryNs
��r-c@s~eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zddd�Zdd�ZdS) �progbarcCs||_t��|_|��dSr)r�	threading�Lock�_refreshlock�
resetstate)�selfrr	r	r�__init__Ys
zprogbar.__init__cCs�g|_i|_i|_i|_d|_t��t|j�dd��|_	d|_
d|_d|_t|j�dd��|_
td|j
t|j�dd���|_|j�dd�|_|j�tdd	�|_dS)
NFrsdelayrsrefresh�schangedelaysformatsestimateinterval)�topics�topicstates�
starttimes�	startvals�printed�time�floatr�config�	lastprint�curtopic�	lasttopic�
indetcount�refresh�max�changedelay�
configlist�order�
configwith�estimateinterval�r3r	r	rr2^s&��
�zprogbar.resetstatecCs�t|j�sdS|��}d|_d}d}	d}
|jD]�}d}|dkr"|}n�|dkr9|r4dtt|��||f}nxd|}ns|�d�r�|r�d	}
d
|vrPt|�	d
�d�}nd|vr`d
}
t|�	d�d�}nd}|
d	krot
j||dd�}nt
�||�}||t
�|�d7}n+|dkr�d}d}	n"|dkr�|r�|}n|dkr�|�
||||�}n|dkr�|�||||�}|	s�t||�}qt|
|�}
q|	�r7d}|r�|t
�|�d7}|
r�|t
�|
�d7}||d}|r�||kr�|||}d|d}|dkr�|d7}|d||7}n*|d8}|jd7_|jd|}||8}dt|t|��ddtt|��}d�d|df�}t|||
�}nt||
�}|�dt
�||��||_|��dS)NT�Fstopicsnumbers%*d/%ds%dsitemsend�-r�+s	beginning�)�leftsidersbarsunitsestimatesspeedrr5�=�>�s<=>�[�]�
)rr�widthr:rF�len�str�
startswith�int�splitr�trim�colwidth�estimate�speedrrA�absr�	_writeerrr@�	_flusherr)r3�now�topic�pos�item�unit�total�	termwidth�head�needprogress�tail�	indicator�add�slice�wid�used�	progwidth�amt�bar�prog�outr	r	r�showss�


���
zprogbar.showcCsL|jr|jrt|j�s
dS|�dd|���|��|jr$d|_dSdS)Ns
%s
rr)r:r>rrr`rUrarIr	r	r�clear�s
�z
progbar.clearcCs<t|j�sdS|j�dd�r|��n|�d�|��dS)Nrsclear-complete�
)rrrrwr`rarIr	r	r�complete�s


zprogbar.completecCst|jjj�dSr)r-rr�flushrIr	r	rra�szprogbar._flusherrcCst|jjj|�dSr)r-rr�write)r3�msgr	r	rr`�rzprogbar._writeerrcCs&|j��}tt|jjdd|d��|�S)Nrswidth)�default)rrh�minrYr=)r3�twr	r	rrU�s
z
progbar.widthc
Cs\|durdS|j|}||}||}|dkr,||j|}||||d}	t|	�SdS)NrJrr)r9r8r')
r3rcrdrgrb�
initialpos�target�delta�elapsedr!r	r	rr]�s
zprogbar.estimatecCs@|j|}||}||j|}|dkrtd�|||fSdS)Nrs	%d %s/secrJ)r9r8r)r3rcrdrfrbr�r�r�r	r	rr^�s
z
progbar.speedcCs.|jdus|j|jks||j|jkrdSdS)z?Check if conditions are met to print - e.g. changedelay elapsedNTF)r@r?r>rD)r3rbr	r	r�
_oktoprint�s

zprogbar._oktoprintcCsr|j}|dkr	dS||j|}||kr7||j|}|||}|dkr'dS|||j|<|||j|<dSdS)a�Adjust starttimes and startvals for topic so ETA works better

        If progress is non-linear (ex. get much slower in the last minute),
        it's more friendly to only use a recent time span for ETA and speed
        calculation.

            [======================================>       ]
                                             ^^^^^^^
                           estimateinterval, only use this for estimation
        rNg�������?)rHr8r9)r3rcrbrd�intervalr�r��newdeltar	r	r�_calibrateestimate�s�zprogbar._calibrateestimaterJNcCs
|dur|�|�dSt��}|j�i||jvr(||j|<||j|<|j�|�||||f|j|<||_|�	|||�||j
|jkrc|jrk|�|�rs||_
|j
||g|j|�R�Wd�dSWd�dSWd�dSWd�dS1s~wYdSr)�
closetopicr;r1r6r8r9�appendr7r?r�r>rBr�rv)r3rcrdrerfrgrbr	r	r�progresss.




���	"�zprogbar.progresscCs�|j�a|j�|d�|j�|d�|j�|d�|jr.|jd|kr.|jr.|��|��||jvrT|jd|j�	|��|_|jrI|jd|_
nd|_
Wd�dSWd�dSWd�dS1sgwYdS)Nr���)r1r8�popr9r7r6r:ryr2�indexr@)r3rcr	r	rr�)s"
�
�"�zprogbar.closetopic)rJrJN)�__name__�
__module__�__qualname__r4r2rvrwryrar`rUr]r^r�r�r�r�r	r	r	rr.XsM		
r.)�
__future__rr)r/r;�i18nr�rrrr'r-�objectr.r	r	r	r�<module>s2

https://t.me/RX1948 - 2025