B e]w@sddlmZmZmZddlmZddlZddlZddlZdgZ ddZ dd d d fd d Z e dZ e dZdZdZejdfddZdS))tqdm TqdmTypeError TqdmKeyError) __version__Nmainc Cstt}|||fd|krdx2|dD]$}y t||Stk rNYq,Xq,Wt|d||dkr|dks||dkrdS|dkrdSt|d|yt|d |d S|d krtt td |d St|d|YnXdS) Nz or z : boolTrueTFalseFz("z")chr") logging getLogger__name__debugsplitcastrevalr ord)valtyplogtr*/tmp/pip-install-b8evvk6i/tqdm/tqdm/cli.pyr s*   r cCsdS)Nr)intrrr&rc Cs|j}|sHx<||}|s0t|ddddS|||t|q Wd}x||}|s|rz|||d||t|ddddSxny||}Wntk r||7}PYqX|||d|t||dd}||t|d}qWqNWdS)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` flushcSsdS)Nrrrrrr8r zposix_pipe..Nr rcSsdS)NrrrrrrIr )writereadgetattrlencountindex ValueError) finfoutdelimbuf_sizecallbackZfp_writetmpbufirrr posix_pipe%s8   r1z\n {8}(\S+)\s{2,}:\s*([^,]+)z\s*(? : {1}{2}N)UNSUPPORTED_OPTSr8).0Zotdrrr szmain..z~Usage: tqdm [--help | options] Options: -h, --help Print this help and exit -v, --version Print version and exit rc3s|]}|kVqdS)Nr)r<v)argvrrr=s)z-vz --versionrc3s|]}|kVqdS)Nr)r<r>)r?rrr=s)z-hz--help rrTr5zargs:z) Error: Usage: tqdm [--help | options] r,rr+bytesFmanpathbuffer)path)copyfile)resource_filename Requirementz tqdm/tqdm.1ztqdm.1zwritten:unitBZ unit_scaleZ unit_divisori)2sysr?r'r( startswithr%r basicConfigr$rrr__init____doc__ CLI_EXTRA_DOCdictRE_OPTSfindallr;poprsorteditemsrzipjoinstripanystdoutr"rexitRE_SHLEXrKeyErrorrstrstdinosrDshutilrE pkg_resourcesrFrGparseinfo setdefaultr1update)fpr?rr0ZlogLeveldZ opt_typesorZopt_types_descoptsZ tqdm_argsr>er,r+Zdelim_per_charrBr_rZrDrErFrGfiforr)r?rrws        *    "  $                      )Zstdrrr_versionrrJrer__all__rr1compilerQr\r;rOstderrrrrrrs 4