o
    ca
                     @   st   d Z ddlmZ ddlZddlZddlZdd ZG dd deZdd	 Z	d
d Z
dd Zdd Zdd Zdd ZdS )z
Wheel command-line utility.
    )print_functionNc                 C   s,   zdd l }W d S  ty   td| w )Nr   z/'{0}' needs pkg_resources (part of setuptools).)pkg_resourcesImportErrorRuntimeErrorformat)namer    r   4/usr/lib/python3/dist-packages/wheel/cli/__init__.pyrequire_pkgresources   s
   r
   c                   @   s   e Zd ZdS )
WheelErrorN)__name__
__module____qualname__r   r   r   r	   r      s    r   c                 C   s   ddl m } || j| j d S )N   )unpack)r   	wheelfiledest)argsr   r   r   r	   unpack_f   s   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                 C   s   ddl m} td|  d S )N   )__version__zwheel %s) r!   print)r   r!   r   r   r	   	version_f&   s   r$   c                     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"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)actionversionzPrint version and exitr&   zShow this helpc                    s      S )N)
print_help)r   pr   r	   <lambda>G   s    zparser.<locals>.<lambda>)argparseArgumentParseradd_subparsers
add_parseradd_argumentset_defaultsr   ospathcurdirr   r   r$   )sunpack_parserrepack_parserconvert_parserversion_parserhelp_parserr   r0   r	   parser+   s6   
rB   c               
   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   )	rB   
parse_argshasattrr/   r)   r   r#   sysstderr)r1   r   er   r   r	   mainL   s   

rI   )__doc__
__future__r   r3   r9   rF   r
   	Exceptionr   r   r   r   r$   rB   rI   r   r   r   r	   <module>   s    !