HEX
Server: LiteSpeed
System: Linux osault1.hostarmada.net 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: tucom (1048)
PHP: 8.4.24
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.6/site-packages/tqdm/__pycache__/cli.cpython-36.pyc
3

	LBjw*�@s�dZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZdgZ
eje�Zdd	�Zd
ddd
�dfdd�Zejd�Zejd�ZdZdZejdfdd�ZdS)zI
Module version for monitoring CLI pipes (`... | python -m tqdm | ...`).
�N)�literal_eval�)�TqdmKeyError�
TqdmTypeError�tqdm)�__version__�maincCs�tj||f�d|krZx2|jd�D]$}y
t||�Stk
rDYq"Xq"Wt|d|��|dkr�|dksr|dkrvdS|dkr�dSt|d|��yt|d	|d
�Stk
r�|dkr�tttd|d���j	�St|d|��YnXdS)
Nz or z : �bool�True�T�FalseFz("z")�chr�")
�log�debug�split�castr�eval�	Exceptionr
�ord�encode)�val�typ�t�r�(/tmp/pip-build-44150kxb/tqdm/tqdm/cli.pyrs(

rs\n�cCsdS)Nr)�floatrrr�<lambda>,srTcCs2|j}|sHx<|j|�}|s0t|ddd���dS||�|t|��qWd}t|�}	x�|j|�}|s�|r�||�|r�|d|j|��nx|j|�D]}
||
�q�Wt|ddd���dSxn|j|�}
|
dkr�||7}P|||d|
t|���||�rdn||d|
��d}||
|	d�}q�WqVWdS)	aZ
    Params
    ------
    fin  : binary file with `read(buf_size : int)` method
    fout  : binary file with `write` (and optionally `flush`) methods.
    callback  : function(float), e.g.: `tqdm.update`
    callback_len  : If (default: True) do `callback(len(buffer))`.
      Otherwise, do `callback(data) for data in buffer.split(delim)`.
    �flushcSsdS)Nrrrrrr>szposix_pipe.<locals>.<lambda>N�rcSsdS)NrrrrrrUsr)�write�read�getattr�len�countr�find)ZfinZfout�delim�buf_size�callback�callback_len�fp_write�tmp�bufZ	len_delim�irrr�
posix_pipe+s>


r/z\n {8}(\S+)\s{2,}:\s*([^,]+)z\s*(?<!\S)--?([^\s=]+)(\s+|=|$)�iterable�gui�out�filea
        Extra CLI Options
        -----------------
        name  : type, optional
            TODO: find out why this is needed.
        delim  : chr, optional
            Delimiting character [default: '\n']. Use '\0' for null.
            N.B.: on Windows systems, Python converts '\n' to '\r\n'.
        buf_size  : int, optional
            String buffer size in bytes [default: 256]
            used when `delim` is specified.
        bytes  : bool, optional
            If true, will count bytes, ignore `delim`, and default
            `unit_scale` to True, `unit_divisor` to 1024, and `unit` to 'B'.
        tee  : bool, optional
            If true, passes `stdin` to both `stderr` and `stdout`.
        update  : bool, optional
            If true, will treat input as newly elapsed iterations,
            i.e. numbers to pass to `update()`. Note that this is slow
            (~2e5 it/s) since every input must be decoded as a number.
        update_to  : bool, optional
            If true, will treat input as total elapsed iterations,
            i.e. numbers to assign to `self.n`. Note that this is slow
            (~2e5 it/s) since every input must be decoded as a number.
        null  : bool, optional
            If true, will discard input (no stdout).
        manpath  : str, optional
            Directory in which to install tqdm man pages.
        comppath  : str, optional
            Directory in which to place tqdm completion.
        log  : str, optional
            CRITICAL|FATAL|ERROR|WARN(ING)|[default: 'INFO']|DEBUG|NOTSET.
c&s��dkrtjdd��y�jd�}WnBtk
rfx,�D] }|jd�r:|td�d�}Pq:Wd}YnX�|d}tjtt|�dd�t	j
jt}t
tj|��}xtD]}|j|�q�Wtjt|j���tj|�}t|ddd�|d	dd�|ddd��}	d
jdd�|	D��}d
}
|
d|jd�d}t�fdd�dED���rbtjjtd�tjd�nht�fdd�dFD���r�tjj|d�tjd�n4��rʈddd	�dk�r�tjjdj �d|
��t!jdjdg����t
t�ddd��ddd���}tj|�|jdd�d�i}y�xj|j�D]^\}}
|j"dd�}yt#|
||�||<Wn0t$k
�r�}zt%t&|���WYdd}~XnX�q,Wtjd t&|��|jd!d"�}|jd#d"�}|jd$d"�}t'|||f�dk�r�t%d%��WnPt(k
�r2�jd&|
�tj)tjj}�x|D]}�|��qW�Y�n�X|jd'd(�}|jd)d*�}|jd+d"�}|jd,d�}|jd-d�}|jd.d"��r�Gd/d0�d0t*�}ntj}t|d1|�}ttj)d1tj)�}|�s�|�rVdd2l+m,}dd3l-m.�yddl/�Wn"t0k
�rdd4l1m2�YnX��fd5d6�}|dk	�r0|d7|j|d7��|dk	�rL|d8|j|d9��tjd�|�r�|j�t�d1��j�G���fd:d0�d0t*�}|�r�|j3d;d<�|j3d=d�|j3d>d?�tj|�t	f|���t4||d
|�j5�WdQRX�n|d*k�r�tj|�|j}|�s|�rft	f|��F�|�r.�fd@dA�}n�fdBdA�}x|D]}||�||��q@WWdQRXn x�t	|f|�D]}||��qtWnhtj|�t	f|��N�d"}|�r��fdCdA�}n|�rʇfdDdA�}n
�j5}d}t4||||||�WdQRXdS)Gz�
    Parameters (internal use only)
    ---------
    fp  : file-like object for tqdm
    argv  : list (default: sys.argv[1:])
    Nrz--logz--log=�INFOz/%(levelname)s:%(module)s:%(lineno)d:%(message)s)�level�format��rcssT|]L}|dtkr|ddkr"dndj|djdd�|df|dd���VqdS)rrr	z
  --{0}  : {2}{3}z
  --{0}=<{1}>  : {2}{3}�_�-N)�UNSUPPORTED_OPTSr6�replace)�.0Zotdrrr�	<genexpr>�szmain.<locals>.<genexpr>z!Usage:
  tqdm [--help | options]
z^
Options:
  -h, --help     Print this help and exit.
  -v, --version  Print version and exit.
�
c3s|]}|�kVqdS)Nr)r=�v)�argvrrr>�s�-v�	--versionrc3s|]}|�kVqdS)Nr)r=r@)rArrr>�s�-h�--helpz--zError:Unknown argument:{0}
{1}� rrTr3r:r9zargs:�bytesF�update�	update_toz1Can only have one of --bytes --update --update_toz
Error:
r(rr's\n�tee�manpath�comppath�nullc@seZdZedd��ZdS)zmain.<locals>.stdoutcSsdS)Nr)r9rrrr!�szmain.<locals>.stdout.writeN)�__name__�
__module__�__qualname__�staticmethodr!rrrr�stdout�srR�buffer)�path)�copyfile)�	resourcesc
sZt�d�r$�t�jd�|�|�n&�jd|��}�t|�|�WdQRXtjd|�dS)zcopy resource `name` to `dst`�filesrNz
written:%s)�hasattr�strrWrTr�info)�name�dst�src)rUrVrr�cp�s

zmain.<locals>.cpztqdm.1z
completion.shztqdm_completion.shcs eZdZe���fdd��ZdS)zmain.<locals>.stdoutc	s,tj�d���|�WdQRX�|�dS)N)r3)rZexternal_write_mode)�x)�fpr+�stdout_writerrr!szmain.<locals>.stdout.writeN)rNrOrPrQr!r)r`r+rarrrRs�unit�BZ
unit_scaleZunit_divisorics�jt|j���dS)N)rH�numeric�decode)r.)rrrr)#szmain.<locals>.callbackcs�jt|j���j�dS)N)rHrdre�n)r.)rrrr)&scs�jt|j���dS)N)rHrdre)r.)rrrr)3scs�jt|j���j�dS)N)rHrdrerf)r.)rrrr)6s)rBrC)rDrE)6�sysrA�index�
ValueError�
startswithr$�logging�basicConfigr#r�__init__�__doc__�
CLI_EXTRA_DOC�dict�RE_OPTS�findallr;�poprr�sorted�itemsr�zip�join�strip�anyrRr!r�exit�stderrr6�RE_SHLEXr<r�KeyErrorrrY�sumr�stdin�object�osrT�shutilrUZimportlib_resources�ImportError�	importlibrV�
setdefaultr/rH)r`rAZlog_idxr.ZlogLevel�dZ	opt_types�orZopt_types_descZ
help_short�optsZ	tqdm_argsr@�eZdelim_per_charrHrIrr(r'rJrKrLrRrTr^r!r)r*r)rArUr`r+rVrarrr�s�




*

"
$





 



)r0r1r2r3)rnrk�rergZastrrdZstdrrr�versionr�__all__�	getLoggerrNrrr/�compilerqr|r;ror{rrrrr�<module>s 
9

#