a
    ¢–Beø  ã                   @   s^   d dl Z d dlmZmZmZ ddlT daeae	a
dadd„ Zd	d
„ Zdd„ ZedkrZeƒ  dS )é    N)ÚPYQT_VERSION_STRÚQDirÚQFileé   )Ú*FÚ c                 C   sæ   t rtj d¡ tƒ }| | ¡ | t ¡ | t¡ | 	t
¡ | t¡ | ¡ sTdS |dkr`d}|rÜ|ržzt|dƒ}W q¤ tyš   tj d| ¡ Y dS 0 ntj}| ¡ D ]}| dt |¡ ¡ q¬|tjurØ| ¡  dS | |¡S )	NúPyQt5 resource compiler
Fú-r   ÚwzUnable to open %s for writing
z%s
T)ÚverboseÚsysÚstderrÚwriteZRCCResourceLibraryZsetInputFilesZ
setVerboseZsetCompressLevelÚcompressLevelZsetCompressThresholdÚcompressThresholdZsetResourceRootÚresourceRootZ	readFilesÚopenÚ	ExceptionÚstdoutZ	dataFilesr   Ú	cleanPathÚcloseÚoutput)ZfilenamesInZfilenameOutÚ	listFilesZlibraryZout_fdÚdf© r   úS/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/PyQt5/pyrcc_main.pyÚprocessResourceFile!   s8    




ÿ

r   c                 C   s0   t j d¡ | r t j d|  ¡ t j d¡ d S )Nr   zpyrcc5: %s
aŸ  Usage: pyrcc5 [options] <inputs>

Options:
    -o file           Write output to file rather than stdout
    -threshold level  Threshold to consider compressing files
    -compress level   Compress input files by level
    -root path        Prefix resource access path with root path
    -no-compress      Disable all compression
    -version          Display version
    -help             Display this information
)r   r   r   )Úerrorr   r   r   ÚshowHelpJ   s    ÿr   c            	      C   s@  d} d}d}g }d }t tjƒ}d}||k �rôtj| }|d7 }|d dk�r¸|dd … }|dkr†||krpd}�qôtj| } |d7 }�qò|dkrÔ||kržd	}�qôt tj| ¡a|d7 }tdksÊtd d
krÒd}�qônâ|dk�r||krîd}�qôttj| ƒa|d7 }n°|dk�r:||k�r"d}�qôttj| ƒa|d7 }n||dk�rJda	nl|dk�rZd}n\|dk�r€tj
 dt ¡ t d¡ n6|dk�s”|dk�ršd}n|dk�rªdand| }�qôq"t |¡�sètj
 dtjd |f ¡ t d¡ | |¡ q"t |ƒdk�s|d u�s|�r$t|ƒ t d¡ t|| |ƒ�s<t d¡ d S )Nr   Fr   r   r	   ÚozMissing output nameÚrootzMissing root pathú/zRoot must start with a /ÚcompresszMissing compression levelÚ	thresholdzMissing compression thresholdr   TÚlistÚversionzpyrcc5 v%s
ÚhelpÚhzno-compresséþÿÿÿzUnknown option: '%s'z%s: File does not exist '%s'
)Úlenr   Úargvr   r   r   Úintr   r   r   r   r   r   Úexitr   ÚexistsÚappendr   r   )	ZoutFilenameZhelpRequestedr   ÚfilesZerrorMsgZargcÚiÚargÚoptr   r   r   Úmain]   s~    












ÿ

r3   Ú__main__)r   ZPyQt5.QtCorer   r   r   Zpyrccr   ZCONSTANT_COMPRESSLEVEL_DEFAULTr   Z"CONSTANT_COMPRESSTHRESHOLD_DEFAULTr   r   r   r   r3   Ú__name__r   r   r   r   Ú<module>   s   )`