
    id                        d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddZ	ddZ
dd	Zdd
ZddZddZddZdZddZddZy)z
Wheel command-line utility.
    )annotationsN)ArgumentTypeError   )
WheelErrorc                J    ddl m }  || j                  | j                         y )N   )unpack)r	   	wheelfiledest)argsr	   s     K/root/searxng-venv/lib/python3.12/site-packages/wheel/_commands/__init__.pyunpack_fr      s    
4>>499%    c                `    ddl m }  || j                  | j                  | j                         y )Nr   )pack)r   	directorydest_dirbuild_number)r   r   s     r   pack_fr      s    (9(9:r   c                `    ddl m }  || j                  | j                  | j                         y )Nr   )convert)r   filesr   verbose)r   r   s     r   	convert_fr      s     DJJt||4r   c                d     ddl m   fd j                  D        }|D ]  }t        |        y )Nr   )tagsc           	   3     K   | ]C  } |j                   j                  j                  j                  j                         E y wN)
python_tagabi_tagplatform_tagbuildremove).0wheelr   r   s     r   	<genexpr>ztags_f.<locals>.<genexpr>$   sH      
  	OOLLJJKK	

s   A	A)r   r%   print)r   namesnamer   s   `  @r   tags_fr*   !   s3    
 ZZ
E  dr   c                    ddl m } 	  || j                  | j                         y # t        $ r}t	        t        |            |d }~ww xY w)Nr   )info)r,   r
   r   FileNotFoundErrorr   str)r   r,   es      r   info_fr0   4   s=    (T^^T\\* (Q a'(s   & 	A	AA	c                ,    ddl m} t        d|        y )Nr   )__version__zwheel ) r2   r'   )r   r2   s     r   	version_fr4   =   s    	F;-
 !r   c                d    | r| d   j                         st        d      d| v rt        d      | S )Nr   z!build tag must begin with a digit-z$invalid character ('-') in build tag)isdigitr   )	build_tags    r   parse_build_tagr9   C   s:    1--/ CDD			 FGGr   ay  Make a new wheel with given tags. Any tags unspecified will remain the same.
Starting the tags with a "+" will append to the existing tags. Starting with a
"-" will remove a tag (use --option=-TAG syntax). Multiple tags can be
separated by ".". The original file will remain unless --remove is given.  The
output filename(s) will be displayed on stdout for further processing.
c                    t        j                         j                  d      } | j                  dd      }|j	                  dddd	       |j	                  d
d       |j                  t               | j                  dd      }|j	                  dd       |j	                  ddt        j                  j                  d       |j	                  dd       |j                  t               | j                  dd      }|j	                  ddd       |j	                  ddt        j                  j                  d       |j	                  ddd        |j                  t               | j                  d!d"t        #      }|j	                  d$dd%       |j	                  d&dd'(       |j	                  d)d*d+,       |j	                  d-d*d.,       |j	                  d/d*d0,       |j	                  d1t        d2d34       |j                  t               | j                  d5d6      }|j	                  d
d7       |j	                  dddd8(       |j                  t               | j                  d9d:      }|j                  t                | j                  d;d<      }|j                  fd=       S )>Ncommands)helpr	   zUnpack wheelz--destz-dzDestination directory.)r<   defaultr
   z
Wheel file)funcr   zRepack wheelr   z$Root directory of the unpacked wheelz
--dest-dirz2Directory to store the wheel (default %(default)s))r>   r<   z--build-numberz"Build tag to use in the wheel namer   zConvert egg or wininst to wheelr   *zFiles to convert)nargsr<   z/Directory to store wheels (default %(default)s)z	--verbosez-v
store_true)actionr   z"Add or replace the tags on a wheel)r<   descriptionr%   zExisting wheel(s) to retagz--removez8Remove the original files, keeping only the renamed ones)rC   r<   z--python-tagTAGzSpecify an interpreter tag(s))metavarr<   z	--abi-tagzSpecify an ABI tag(s)z--platform-tagzSpecify a platform tag(s)z--buildBUILDzSpecify a build tag)typerF   r<   r,   z#Show information about a wheel filez"Wheel file to show information forzShow detailed file listingversionzPrint version and exitr<   zShow this helpc                $    j                         S r   )
print_help)r   ps    r   <lambda>zparser.<locals>.<lambda>   s    q||~ r   )argparseArgumentParseradd_subparsers
add_parseradd_argumentset_defaultsr   ospathcurdirr   r   	TAGS_HELPr9   r*   r0   r4   )	sunpack_parserrepack_parserconvert_parsertags_parserinfo_parserversion_parserhelp_parserrL   s	           @r   parserr`   U   s   !A	j)ALLL?M$4c   {>H-LLnL=M{1WXA	   C   F+\\)2S\TNs9KL>	    T,GY/,,9y  K WC6RSG  
 ,K   [%>UV%.I   ?T   &),,v,Q,RK[/STT,5Q   &)\\)2J\KNY/,,v,<,=K"=>Hr   c                     t               } | j                         }t        |d      s| j                          y	 |j	                  |       y# t
        $ r%}t        |t        j                         Y d }~yd }~ww xY w)Nr?   r   )filer   )	r`   
parse_argshasattrrK   r?   r   r'   sysstderr)rL   r   r/   s      r   mainrg      sc    A<<>D4 	 	&IIdO 	&!#**%%	&s   A 	A9A44A9)r   zargparse.NamespacereturnNone)r8   r.   rh   r.   )rh   zargparse.ArgumentParser)rh   int)__doc__
__future__r   rN   rT   re   r   r
   r   r   r   r   r*   r0   r4   r9   rW   r`   rg    r   r   <module>rn      sT    #  	 
 & "&;5&("	EPr   