B
    Z                 @   sb   d dl Z d dlZd dlmZ ddlmZ ddlmZmZ dej	ej
f Zdd Zed	kr^e  dS )
    N)QtCore   )Driver)NoSuchClassErrorNoSuchWidgetErrorz3Python User Interface Compiler %s for Qt version %sc           
   C   s  t jdtd} | jddddddd	 | jd
dddddd | jddddddd	 | jddddddd	 | jdddddddd d! t j| d"d#}|jd$d%d&d'd( |jd)d*ddd+d	 |jd,d-dd.d/d0d1d! | | |  \}}t|d2krtj	
d3 td2 t||d4 }d2}y| }W n tk
rR } z|| W d d }~X Y n tk
r~ } z|| W d d }~X Y n tk
r } z|| W d d }~X Y nZ tk
r } z|| W d d }~X Y n. tk
r } z|| W d d }~X Y nX t| d S )5Nzpyuic5 [options] <ui-file>)Zusageversionz-pz	--previewZpreview
store_trueFz3show a preview of the UI instead of generating code)destactiondefaulthelpz-oz--outputoutput-ZFILEz.write generated code to FILE instead of stdout)r	   r   metavarr   z-xz	--executeZexecutez1generate extra code to test and display the classz-dz--debugdebugzshow debug outputz-iz--indentindentZstoreint   Nz8set indent width to N spaces, tab if N is 0 [default: 4])r	   r
   typer   r   r   zCode generation options)titlez--import-fromZimport_fromZPACKAGEzSgenerate imports of pyrcc5 generated modules in the style 'from PACKAGE import ...')r	   r   r   z--from-importsZfrom_importsz#the equivalent of '--import-from=.'z--resource-suffixZresource_suffixstringZ_rcZSUFFIXz>append SUFFIX to the basename of resource files [default: _rc]r   z+Error: one input ui-file must be specified
r   )optparseZOptionParserVersionZ
add_optionZOptionGroupZadd_option_group
parse_argslensysstderrwriteexitr   ZinvokeIOErrorZ
on_IOErrorSyntaxErrorZon_SyntaxErrorr   Zon_NoSuchClassErrorr   Zon_NoSuchWidgetError	ExceptionZon_Exception)parsergZoptsargsdriverZexit_statuse r(   .lib/python3.7/site-packages/PyQt5/uic/pyuic.pymain#   sX    






r*   __main__)r   r   ZPyQt5r   r&   r   
exceptionsr   r   ZPYQT_VERSION_STRZQT_VERSION_STRr   r*   __name__r(   r(   r(   r)   <module>   s   <