Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
1576 views


�W��@s�ddlmZmZmZddlmZddlZddlZdgZdd�Z	dd	d
d�dd
�Z
ejd�Zejd�Z
dZdZdd�ZdS)�)�tqdm�
TqdmTypeError�TqdmKeyError)�__version__�N�maincCs�|dkrL|dks$|dkr(dS|dkr8dSt|d|��yt|d|d	�SWnF|d
kr�tttd|d���St|d|��YnXdS)N�bool�True�T�FalseFz : z("z")�chr�")r�evalr�ord)�val�typ�r�)lib/python3.5/site-packages/tqdm/_main.py�castsr�
�cCsdS)Nr)�intrrr�<lambda>src	Cs�|j}d}d}x�|j|�}|sq|rT||�|d|j|��t|ddd���dSx�y|j|�}Wntk
r�||7}PYqtX|||d|t|���|d�d}||t|�d�}qtWqWdS)z�
    Params
    ------
    fin  : file with `read(buf_size : int)` method
    fout  : file with `write` (and optionally `flush`) methods.
    callback  : function(int), e.g.: `tqdm.update`
    r
r�flushcSsdS)Nrrrrrr1szposix_pipe.<locals>.<lambda>N)�write�read�count�getattr�index�
ValueError�len)	ZfinZfout�delim�buf_size�callbackZfp_writeZbufZtmp�irrr�
posix_pipes*
	


"
r%z\n {8}(\S+)\s{2,}:\s*([^\s,]+)z\s*--?([^\s=]+)(?:\s*|=|$)�iterable�gui�out�filead
        Extra CLI Options
        -----------------
        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.
cCs�tjjt}ttj|��}xtD]}|j|�q,Wtj	|�}t
|ddd�|ddd�|ddd��}djdd�|D��}d|jd�d}t
d	d�dD��r�tjjtd�tjd�n:t
d
d�dD��r5tjj|d�tjd�tj	djtj��}tt
|ddd�|ddd���}i}yvxo|j�D]a\}}	yt|	||�||<Wq�tk
r�}
ztt|
���WYdd}
~
Xq�Xq�WWn?tjjd�x!tjD]}tjj|�qW�Yn�X|jdd�}|jdd�}
|dkr�xbttj|�D]}tjj|�q�Wn5t|��&}ttjtj||
|j�WdQRXdS)Nr��r
css.|]$}|dtkrdj|�VqdS)rz
  --{0}=<{0}>  : {1}{2}N)�UNSUPPORTED_OPTS�format)�.0Zotdrrr�	<genexpr>aszmain.<locals>.<genexpr>z~Usage:
  tqdm [--help | options]

Options:
  -h, --help     Print this help and exit
  -v, --version  Print version and exit

rcss|]}|tjkVqdS)N)�sys�argv)r.�vrrrr/ns�-v�	--versionrcss|]}|tjkVqdS)N)r0r1)r.r2rrrr/qs�-h�--help� z)
Error:
Usage:
  tqdm [--help | options]
r!r"r)r3r4)r5r6)r�__init__�__doc__�
CLI_EXTRA_DOC�dict�RE_OPTS�findallr,�pop�split�zip�join�strip�anyr0�stdoutrr�exit�RE_SHLEXr1�itemsr�KeyErrorr�str�stderr�stdinr%�update)�dZ	opt_types�or?Zopt_types_descr9r1ZoptsZ	tqdm_argsr2�er$r!r"�trrrrVsJ
9
	
/-)ziterabler'zoutzfile)Z_tqdmrrrZ_versionrr0�re�__all__rr%�compiler<rFr,r:rrrrr�<module>s	'