Your IP : 18.118.33.239


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/filecmp.cpython-310.opt-2.pyc

o

6��f�'�@s�	ddlZddlZddlmZddlmZgd�ZiZdZgd�Z	dd�Z
dd
d�Zdd
�Zdd�Z
Gdd�d�Zddd�Zeefdd�Zdd�Zdd�ZedkrVe�dSdS)�N)�filterfalse)�GenericAlias)�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi )ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCs	t��dS�N)�_cache�clear�r
r
�./opt/alt/python310/lib64/python3.10/filecmp.pyrsrTcCs�	tt�|��}tt�|��}|dtjks|dtjkrdS|r'||kr'dS|d|dkr1dSt�||||f�}|durTt||�}tt�dkrLt�|t||||f<|S)NrFT��d)	�_sig�os�stat�S_IFREGr�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomer
r
rrs 
rcCst�|j�|j|jfSr
)r�S_IFMT�st_mode�st_size�st_mtime)�str
r
rrFs
�rc	Cs�t}t|d��G}t|d��1}	|�|�}|�|�}||kr,	Wd�Wd�dS|s=	Wd�Wd�dSq1sAwYWd�dS1sQwYdS)N�rbTF)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2r
r
rrKs

��4�rc@s�eZdZ	ddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Ze
eeeeeeeeeeeed�Zdd�Zee�ZdS)rNcCsF||_||_|durtjtjg|_n||_|durt|_dS||_dSr
)�left�rightr�curdir�pardir�hider�ignore)�self�a�br.r-r
r
r�__init__|s

zdircmp.__init__cCsPtt�|j�|j|j�|_tt�|j�|j|j�|_|j�	�|j�	�dSr
)
�_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|���|_dSr
)�dict�zip�mapr�path�normcaser5r6�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r/r0r1r
r
r�phase1�s
z
dircmp.phase1c		Csg|_g|_g|_|jD]x}tj�|j|�}tj�|j|�}d}zt�	|�}Wnt
y2d}Ynwzt�	|�}Wnt
yEd}Ynw|r~t	�|j�}t	�|j�}||kr_|j�
|�qt	�|�rk|j�
|�qt	�|�rw|j�
|�q|j�
|�q|j�
|�qdS)Nrr)�common_dirs�common_files�common_funnyrCrr=�joinr)r*r�OSErrorrr�append�S_ISDIR�S_ISREG)	r/�xZa_pathZb_path�okZa_statZb_statZa_typeZb_typer
r
r�phase2�s:
��

�z
dircmp.phase2cCs&t|j|j|j�}|\|_|_|_dSr
)rr)r*rH�
same_files�
diff_files�funny_files)r/Zxxr
r
r�phase3�sz
dircmp.phase3cCsPi|_|jD]}tj�|j|�}tj�|j|�}|�|||j|j	�|j|<qdSr
)
�subdirsrGrr=rJr)r*�	__class__r.r-)r/rOZa_xZb_xr
r
r�phase4�s
�z
dircmp.phase4cCs$|��|j��D]}|��q	dSr
)rXrV�values�phase4_closure�r/Zsdr
r
rrZ�s
�zdircmp.phase4_closurecCs�td|j|j�|jr|j��td|jd|j�|jr*|j��td|jd|j�|jr8|j��td|j�|jrF|j��td|j�|jrT|j��td|j�|j	rb|j	��td|j	�|j
rr|j
��td|j
�dSdS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr)r*rDr7rErRrSrTrGrIr8r
r
r�report�s.






�z
dircmp.reportcCs*|��|j��D]	}t�|��q	dSr
)r^rVrYr]r[r
r
r�report_partial_closure��

�zdircmp.report_partial_closurecCs*|��|j��D]	}t�|��q	dSr
)r^rVrYr]�report_full_closurer[r
r
rra�r`zdircmp.report_full_closure)rVrRrSrTrGrHrIrCrDrEr5r6cCs*||jvr	t|��|j||�t||�Sr
)�	methodmap�AttributeError�getattr)r/�attrr
r
r�__getattr__�s

zdircmp.__getattr__)NN)�__name__�
__module__�__qualname__r2r9rFrQrUrXrZr^r_rar:rbrf�classmethodr�__class_getitem__r
r
r
rrXs(
##�rcCsL	gggf}|D]}tj�||�}tj�||�}|t|||��|�q|Sr
)rr=rJ�_cmprL)r0r1rCr�resrOZaxZbxr
r
rrs
rcCs*z
|||||��WStyYdSw)N�)rK)r0r1Zsh�absrr
r
rrls
�rlcCstt|j|��Sr
)r?rrB)Zflist�skipr
r
rr3&sr3cCstddl}ddl}|�|jdd�d�\}}t|�dkr!|�dd��t|d|d�}d|vr4|��dS|��dS)Nrr�rrnzneed exactly two args)z-r�)�sys�getopt�argvrZGetoptErrorrrar^)rsrtZoptions�argsZddr
r
r�demo,srw�__main__)T)rr�	itertoolsr�typesr�__all__rr#rrrrrrrrorlr3rwrgr
r
r
r�<module>s,
(

+	
�

?>