File: //usr/local/lib/python3.6/site-packages/tqdm/__pycache__/asyncio.cpython-36.pyc
3
LBj�
� @ s^ d Z ddlZddlmZ ddlmZ ddgiZdd d
dgZG dd� de�Z d
d � Z
e Ze
ZdS )z�
Asynchronous progressbar decorator for iterators.
Includes a default `range` iterator printing to `stderr`.
Usage:
>>> from tqdm.asyncio import trange, tqdm
>>> async for i in trange(10):
... ...
� N)�version_info� )�tqdmzgithub.com/Z casperdcl�tqdm_asyncio�taranger �trangec sf e Zd ZdZd� fdd� Zdd� Zdd� Zd d
� Zedddd�dd
��Z edddd�dd��Z
� ZS )r z>
Asynchronous-friendly version of tqdm (Python 3.6+).
Nc sl t t| �j|f|�|� d| _|d k rht|d�r@|j| _d| _n(t|d�rT|j| _nt|�| _ | j j| _d S )NF� __anext__T�__next__)
�superr �__init__�iterable_awaitable�hasattrr �
iterable_nextr �iterZiterable_iterator)�self�iterable�args�kwargs)� __class__� �,/tmp/pip-build-44150kxb/tqdm/tqdm/asyncio.pyr s
ztqdm_asyncio.__init__c C s | S )Nr )r r r r � __aiter__$ s ztqdm_asyncio.__aiter__c � sl y*| j r| j� I d H }n| j� }| j� |S tk
rJ | j� t�Y n tk
rf | j� � Y nX d S )N)r r �update�
StopIteration�close�StopAsyncIteration�
BaseException)r �resr r r r '