AlkantarClanX12

Your IP : 3.142.172.190


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/filecmp.cpython-35.opt-2.pyc



���]f&�@s�ddlZddlZddlmZdddddgZiZd"Zd
ddd
ddddgZdd�Zddd�Z	dd�Z
dd�ZGdd�d�Zddd�Z
ee	dd�Zdd�Zdd �Zed!kr�e�dS)#�N)�filterfalse�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORES�iZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCstj�dS)N)�_cache�clear�rr�,/opt/alt/python35/lib64/python3.5/filecmp.pyrsTcCs�ttj|��}ttj|��}|dtjksP|dtjkrTdS|rj||krjdS|d|dkr�dStj||||f�}|dkr�t||�}tt�dkr�t�|t||||f<|S)NrFT��d)	�_sig�os�stat�S_IFREGr
�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomerrr
rs&cCstj|j�|j|jfS)N)r�S_IFMT�st_mode�st_size�st_mtime)�strrr
rDsrcCs{t}t|d��_}t|d��F}x<|j|�}|j|�}||kr[dS|s-dSq-WWdQRXWdQRXdS)N�rbFT)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2rrr
rIs$rc@s�eZdZdddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Ze
dedededededededededed ed!e�Zd"d#�ZdS)$rNcCsd||_||_|dkr6tjtjg|_n	||_|dkrWt|_n	||_dS)N)�left�rightr�curdir�pardir�hider�ignore)�self�a�br-r,rrr
�__init__xs			zdircmp.__init__cCsnttj|j�|j|j�|_ttj|j�|j|j�|_|jj	�|jj	�dS)N)
�_filterr�listdirr(r,r-�	left_listr)�
right_list�sort)r.rrr
�phase0�s
z
dircmp.phase0cCs�ttttjj|j�|j��}ttttjj|j�|j��}tt|j	t
|j|���|_tt|j	t
|j|���|_tt|j	t
|j|���|_dS)N)�dict�zip�mapr�path�normcaser4r5�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r.r/r0rrr
�phase1�s
**''z
dircmp.phase1c
Cs�g|_g|_g|_xy|jD]n}tjj|j|�}tjj|j|�}d}ytj	|�}Wn+t
k
r�}zd}WYdd}~XnXytj	|�}Wn+t
k
r�}zd}WYdd}~XnX|r�t	j|j�}t	j|j�}	||	kr,|jj
|�q�t	j|�rN|jj
|�q�t	j|�rp|jj
|�q�|jj
|�q%|jj
|�q%WdS)Nrr)�common_dirs�common_files�common_funnyrArr;�joinr(r)r�OSErrorrr�append�S_ISDIR�S_ISREG)
r.�xZa_pathZb_path�okZa_stat�whyZb_statZa_typeZb_typerrr
�phase2�s4			z
dircmp.phase2cCs7t|j|j|j�}|\|_|_|_dS)N)rr(r)rF�
same_files�
diff_files�funny_files)r.Zxxrrr
�phase3�sz
dircmp.phase3cCssi|_xc|jD]X}tjj|j|�}tjj|j|�}t|||j|j	�|j|<qWdS)N)
�subdirsrErr;rHr(r)rr-r,)r.rMZa_xZb_xrrr
�phase4�s
	z
dircmp.phase4cCs2|j�x!|jj�D]}|j�qWdS)N)rVrU�values�phase4_closure)r.�sdrrr
rX�s
zdircmp.phase4_closurecCs6td|j|j�|jrE|jj�td|jd|j�|jrt|jj�td|jd|j�|jr�|jj�td|j�|jr�|jj�td|j�|jr�|jj�td|j�|j	r|j	j�td|j	�|j
r2|j
j�td|j
�dS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr(r)rBr6rCrQrRrSrErG)r.rrr
�report�s,	
	
	
	
	
	
	
z
dircmp.reportcCs9|j�x(|jj�D]}t�|j�qWdS)N)r\rUrWr[)r.rYrrr
�report_partial_closure�s
zdircmp.report_partial_closurecCs9|j�x(|jj�D]}t�|j�qWdS)N)r\rUrWr[�report_full_closure)r.rYrrr
r^�s
zdircmp.report_full_closurerUrQrRrSrErFrGrArBrCr4r5cCs9||jkrt|��|j||�t||�S)N)�	methodmap�AttributeError�getattr)r.�attrrrr
�__getattr__�szdircmp.__getattr__)�__name__�
__module__�__qualname__r1r7rDrPrTrVrXr\r]r^r8r_rcrrrr
rVs "#
cCskgggf}xU|D]M}tjj||�}tjj||�}|t|||�j|�qW|S)N)rr;rH�_cmprJ)r/r0rAr�resrMZaxZbxrrr
r�s

!cCs8y|||||��SWntk
r3dSYnXdS)N�)rI)r/r0�sh�absrrrr
rgs
rgcCstt|j|��S)N)r=rr@)�flist�skiprrr
r2sr2cCs�ddl}ddl}|j|jdd�d�\}}t|�dkra|jdd��t|d|d�}d|kr�|j�n
|j�dS)	Nrr�rrizneed exactly two args�-r�)rorp)�sys�getopt�argvrZGetoptErrorrr^r\)rqrr�options�args�ddrrr
�demo$s%
rw�__main__i )rr�	itertoolsr�__all__r
r"rrrrrrrrkrgr2rwrdrrrr
�<module>
s"'
�