Your IP : 18.191.198.245


Current Path : /opt/hc_python/share/doc/pycurl/examples/__pycache__/
Upload File :
Current File : //opt/hc_python/share/doc/pycurl/examples/__pycache__/retriever.cpython-38.pyc

U

hfi
�@s
ddlZddlZzddlZWnek
r8ddlZYnXddlZzddlZddlmZmZWnek
rrYnXe�ee�dZ	zLej
ddkr�ej��Z
neej
d���Z
eej
�dkr�eej
d�Z	Wn"edej
d�e�YnXe��Ze
D]FZe��Ze�redd	k�r$�qd
eej�dZe�eef��qej�sXtd��eej�Zee	e�Z	de	k�r�dk�s�ntd
��edejejf�edede	d�Gdd�dej�ZgZee	�D] Z ee�Z!e!�"�e�#e!��q�eD]Z$e$�%��q�dS)�N)�SIGPIPE�SIG_IGN�
��-��zCUsage: %s <file with URLs to fetch> [<# of concurrent connections>]�#zdoc_%03d.datz
no URLs giveni'z(invalid number of concurrent connectionsz!PycURL %s (compiled against 0x%x)z
----- Gettingz
URLs usingzconnections -----c@seZdZdd�Zdd�ZdS)�WorkerThreadcCstj�|�||_dS)N)�	threading�Thread�__init__�queue)�selfr�r�\/opt/hc_python/lib64/python3.8/site-packages/../../../share/doc/pycurl/examples/retriever.pyr
>szWorkerThread.__init__cCsz|j��\}}Wntjk
r,t�YnXt|d�}t��}|�tj	|�|�tj
d�|�tjd�|�tjd�|�tj
d�|�tjd�|�tj|�z|��Wn,ddl}|jtjd�tj��YnX|��|��tj�d�tj��qdS)	N�wbr��i,r)�file�.)r�
get_nowait�Queue�Empty�
SystemExit�open�pycurlZCurlZsetopt�URLZFOLLOWLOCATIONZ	MAXREDIRSZCONNECTTIMEOUT�TIMEOUTZNOSIGNALZ	WRITEDATAZperform�	traceback�	print_exc�sys�stderr�flush�close�stdout�write)r�url�filename�fpZcurlrrrr�runBs.

zWorkerThread.runN)�__name__�
__module__�__qualname__r
r*rrrrr
=sr
)&r!rr�ImportErrorrr�signalrrZnum_conn�argv�stdin�	readlines�urlsr�len�int�printrr'�stripr(�put�AssertionErrorZnum_urls�min�versionZCOMPILE_LIBCURL_VERSION_NUMrr
�threads�range�dummy�t�start�append�thread�joinrrrr�<module>
sT


"!

?>