
    sh#                        S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	  / SQr
Sr\" \5      R                  r\4SS jjr\S	4SS
 jjrSS jrSS jrg)    )annotationsN)Path)	HTTPError)urlopen)DOWNLOAD_DIRretrieve_fileoutput_fileurls_from_file)zhttp://zhttps://zgithub.com/z/raw/c                    U R                  5       n[         H@  nUR                  US5      R                  5       R                  S5      R                  5       nMB     [        U[        R
                  " SSU5      5      $ )N z/:z[^\-_\.\w\d]+_)stripNAME_REMOVEreplacer   resub)urldownload_dir	file_nameparts       ~/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/setuptools/tests/config/downloads/__init__.pyr	   r	      sa    		I%%dB/557==dCIIK	 bff%5sIFGG       c                ,   [        X5      nUR                  5       (       a  [        SU  SU S35        U$ UR                  SSS9  [        SU  SU 35         [	        X5        U$ ! [
         a%    [        R                  " U5        [	        X5         U$ f = f)Nz	Skipping z (already exists: )T)exist_okparentszDownloading z to )r	   existsprintmkdirdownloadr   timesleep)r   r   waitpaths       r   r   r      s    s)D{{}}	#0a89 K 	D$7SEdV,-	 S K  	 JJtSK	 s   A$ $+BBc                    [        SU  35        U R                  SS9nUR                  5        Vs/ s H  o"R                  S5      (       a  M  UPM     sn$ s  snf )zV``list_file`` should be a text file where each line corresponds to a URL to
download.
zfile: zutf-8)encoding#)r   	read_text
splitlines
startswith)	list_filecontentr   s      r   r
   r
   +   sR     
F9+
!!7!3G"--/K/C~~c7JC/KKKs   AAc                   [        U 5       nUR                  5       nS S S 5        [        US5       nUR                  W5        S S S 5        [	        U5      R                  5       (       d   eg ! , (       d  f       NU= f! , (       d  f       N@= f)Nwb)r   readopenwriter   r   )r   destfdatas       r   r!   r!   4   se    	vvx 
 
dD	Q	 
 : 
 
	s   A,A=,
A:=
B)r   strr   r   returnr   )r   r6   r   r   r$   floatr7   r   )r,   r   r7   z	list[str])r   r6   r3   r   )
__future__r   r   r"   pathlibr   urllib.errorr   urllib.requestr   __all__r   __file__parentr   r	   r   r
   r!    r   r   <module>rA      sT    " 	   " "
L >H~$$ 0< H 2>Q Lr   