o
    6‘ðid  ã                   @  s¢   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d„Z	d"dd„Z
d"dd„Zd"dd„Zd"dd„Zd"dd„Zd#dd„ZdZd$dd„Zd%d d!„ZdS )&z
Wheel command-line utility.
é    )ÚannotationsN)ÚArgumentTypeErroré   )Ú
WheelErrorÚargsúargparse.NamespaceÚreturnÚNonec                 C  s   ddl m } || j| jƒ d S )Né   )Úunpack)r   Ú	wheelfileÚdest)r   r   © r   úW/root/parts/websockify/install/lib/python3.10/site-packages/wheel/_commands/__init__.pyÚunpack_f   ó   r   c                 C  ó"   ddl m } || j| j| jƒ d S )Nr
   )Úpack)r   Ú	directoryÚdest_dirÚbuild_number)r   r   r   r   r   Úpack_f   ó   r   c                 C  r   )Nr
   )Úconvert)r   Úfilesr   Úverbose)r   r   r   r   r   Ú	convert_f   r   r   c                   s8   ddl m ‰ ‡ ‡fdd„ˆ jD ƒ}|D ]}t|ƒ qd S )Nr
   )Útagsc                 3  s,   � | ]}ˆ|ˆ j ˆ jˆ jˆ jˆ jƒV  qd S ©N)Ú
python_tagÚabi_tagÚplatform_tagÚbuildÚremove)Ú.0Úwheel©r   r   r   r   Ú	<genexpr>$   s   € 	øú
ÿztags_f.<locals>.<genexpr>)r   r%   Úprint)r   ÚnamesÚnamer   r&   r   Útags_f!   s   	÷
ÿr+   c              
   C  sH   ddl m } z
|| j| jƒ W d S  ty# } ztt|ƒƒ|‚d }~ww )Nr
   )Úinfo)r,   r   r   ÚFileNotFoundErrorr   Ústr)r   r,   Úer   r   r   Úinfo_f4   s   €ÿr0   c                 C  s   ddl m} td|› �ƒ d S )Nr   )Ú__version__zwheel )Ú r1   r(   )r   r1   r   r   r   Ú	version_f=   r   r3   Ú	build_tagr.   c                 C  s,   | r| d   ¡ 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   )r4   r   r   r   Úparse_build_tagC   s
   r7   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.
úargparse.ArgumentParserc                    sâ  t  ¡ ‰ ˆ jdd�} | jddd�}|jddddd	� |jd
dd� |jtd� | jddd�}|jddd� |jddtjj	dd� |jddd� |jt
d� | jddd�}|jdddd� |jddtjj	dd� |jdddd � |jtd� | jd!d"td#�}|jd$dd%d� |jd&dd'd(� |jd)d*d+d,� |jd-d*d.d,� |jd/d*d0d,� |jd1td2d3d4� |jtd� | jd5d6d�}|jd
d7d� |jdddd8d(� |jtd� | jd9d:d�}|jtd� | jd;d<d�}|j‡ fd=d>„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)rA   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)ÚtyperD   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                   s   ˆ   ¡ S r   )Ú
print_help)r   ©Úpr   r   Ú<lambda>˜   s    zparser.<locals>.<lambda>)ÚargparseÚArgumentParserÚadd_subparsersÚ
add_parserÚadd_argumentÚset_defaultsr   ÚosÚpathÚcurdirr   r   Ú	TAGS_HELPr7   r+   r0   r3   )ÚsÚunpack_parserÚrepack_parserÚconvert_parserÚtags_parserÚinfo_parserÚversion_parserÚhelp_parserr   rI   r   ÚparserU   sz   ÿüÿüÿýÿÿÿÿr^   Úintc               
   C  sj   t ƒ } |  ¡ }t|dƒs|  ¡  dS z| |¡ W dS  ty4 } zt|tjd� W Y d }~dS d }~ww )Nr=   r   )Úfiler
   )	r^   Ú
parse_argsÚhasattrrH   r=   r   r(   ÚsysÚstderr)rJ   r   r/   r   r   r   Úmain�   s   
ú
€ýre   )r   r   r   r	   )r4   r.   r   r.   )r   r8   )r   r_   )Ú__doc__Ú
__future__r   rL   rR   rc   r   r   r   r   r   r   r+   r0   r3   r7   rU   r^   re   r   r   r   r   Ú<module>   s"    





	
	
	H