+
    i)  c                   s    R t ^ RIt^ RIt^ RIHt ^ RIHt . ROt/ tRt	. ROt
R tRR ltR tR t ! R	 R4      tRR
 lt]]3R ltR tR t]R8X  d
   ]! 4        R# R# )zUtilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=True) -> int
    cmpfiles(a, b, common) -> ([], [], [])
    clear_cache()

N)filterfalse)GenericAliasdircmpc                 s.    \         P                  4        R# )zClear the filecmp cache.N)_cacheZclear      /usr/lib64/python3.14/filecmp.pyclear_cacher      s    
LLNr   c                s   \        \        P                  ! V 4      4      p\        \        P                  ! V4      4      pV^ ,          \        P                  8w  g   V^ ,          \        P                  8w  d   R# V'       d	   W48X  d   R# V^,          V^,          8w  d   R# \        P                  WW434      pVf5   \        W4      p\        \        4      ^d8  d   \        4        V\        WW43&   V# )a  Compare two files.

Arguments:

f1 -- First file name

f2 -- Second file name

shallow -- treat files as identical if their stat signatures (type, size,
           mtime) are identical. Otherwise, files are considered different
           if their sizes or contents differ.  [default: True]

Return value:

True if the files are the same, False otherwise.

This function uses a cache for past comparisons and the results,
with cache entries invalidated if their stat information
changes.  The cache may be cleared by calling clear_cache().

FT)	_sigosstatZS_IFREGr   Zget_do_cmplenr   )f1f2shallowZs1Zs2Zoutcomes   &&&   r   cmpr      s    . 
bggbk	B	bggbk	B	!u1 528	!u1~jj"")*G"/v;M!(rr~Nr   c                 sp    \         P                  ! V P                  4      V P                  V P                  3# N)r
   S_IFMTst_modeZst_sizeZst_mtime)Zst   &r   r   r   F   s*    KK

#JJKK r   c           	      sv   \         p\        V R 4      ;_uu_ 4       p\        VR 4      ;_uu_ 4       p VP                  V4      pVP                  V4      pWV8w  d    RRR4       RRR4       R# V'       d   KF   RRR4       RRR4       R#   + '       g   i     M; iRRR4       R#   + '       g   i     R# ; i)ZrbTNF)BUFSIZEZopenZread)r   r   ZbufsizeZfp1Zfp2Zb1Zb2s   &&     r   r   r   K   sq    G	b$3R#'"B'"Bx !/ 2 !/s4   B'+B
	B'-B
	7B
	8B'
BB''B8	c                   s   a  ] tR t^Xt o RtRRR/R lltR tR tR tR	 t	R
 t
R tR tR tR t]! ]
]	]	]	]]]]]]]]R7      tR t]! ]4      tRtV tR# )r   a  A class that manages the comparison of 2 directories.

dircmp(a, b, ignore=None, hide=None, *, shallow=True)
  A and B are directories.
  IGNORE is a list of names to ignore,
    defaults to DEFAULT_IGNORES.
  HIDE is a list of names to hide,
    defaults to [os.curdir, os.pardir].
  SHALLOW specifies whether to just check the stat signature (do not read
    the files).
    defaults to True.

High level usage:
  x = dircmp(dir1, dir2)
  x.report() -> prints a report on the differences between dir1 and dir2
   or
  x.report_partial_closure() -> prints report on differences between dir1
        and dir2, and reports on common immediate subdirectories.
  x.report_full_closure() -> like report_partial_closure,
        but fully recursive.

Attributes:
 left_list, right_list: The files in dir1 and dir2,
    filtered by hide and ignore.
 common: a list of names in both dir1 and dir2.
 left_only, right_only: names only in dir1, dir2.
 common_dirs: subdirectories in both dir1 and dir2.
 common_files: files in both dir1 and dir2.
 common_funny: names in both dir1 and dir2 where the type differs between
    dir1 and dir2, or the name is not stat-able.
 same_files: list of identical files.
 diff_files: list of filenames which differ.
 funny_files: list of files which could not be compared.
 subdirs: a dictionary of dircmp instances (or MyDirCmp instances if this
   object is of type MyDirCmp, a subclass of dircmp), keyed by names
   in common_dirs.
 Nr   Tc               s    Wn         W n        Vf'   \        P                  \        P                  .V n        MW@n        Vf   \        V n        MW0n        WPn        R # r   )	leftrightr	   ZcurdirZpardirhideDEFAULT_IGNORESignorer   )selfabr   r   r   s   &&&&&$r   __init__Zdircmp.__init__   s@    	
<BII.DII>)DK Kr   c                s   \        \        P                  ! V P                  4      V P                  V P
                  ,           4      V n        \        \        P                  ! V P                  4      V P                  V P
                  ,           4      V n        V P                  P                  4        V P                  P                  4        R # r   )
_filterr	   Zlistdirr   r   r   	left_listr   
right_listsortr   r   r   phase0Zdircmp.phase0   sx     DII!6!%4;;!68!"**TZZ"8"&))DKK"79r   c           	     s   \        \        \        \        P                  P
                  V P                  4      V P                  4      4      p\        \        \        \        P                  P
                  V P                  4      V P                  4      4      p\        \        VP                  \        VP                  V4      4      4      V n        \        \        VP                  \        VP                  V4      4      4      V n        \        \        VP                  \        VP                  V4      4      4      V n        R # r   )dictZzipZmapr	   pathZnormcaser    r!   listZ__getitem__Zfilter__contains__commonr    	left_only
right_only)r   r   r   s   &  r   phase1Zdircmp.phase1   s    S))4>>:DNNKLS))4??;T__MN3q}}fQ^^Q.GHIc!--Q^^Q1OPQs1==+anna2PQRr   c                s   . V n         . V n        . V n        V P                   EF  p\        P
                  P                  V P                  V4      p\        P
                  P                  V P                  V4      pR p \        P                  ! V4      p \        P                  ! V4      pV'       d   \        P                  ! XP                  4      p\        P                  ! XP                  4      pWx8w  d   V P                  P                  V4       K  \        P                  ! V4      '       d   V P                   P                  V4       EK-  \        P                   ! V4      '       d   V P                  P                  V4       EKg  V P                  P                  V4       EK  V P                  P                  V4       EK  	  R#   \        \        3 d    Rp ELLi ; i  \        \        3 d    Rp ELOi ; i)TFN)common_dirscommon_filescommon_funnyr)   r	   r&   joinr   r   r
   OSError
ValueErrorr   r   appendZS_ISDIRZS_ISREG)	r   xZa_pathZb_pathZokZa_statZb_statZa_typeZb_types	   &        r   phase2Zdircmp.phase2   si   AWW\\$))Q/FWW\\$**a0FB
 V^^4V^^4#%%,,Q/\\&))$$++A.\\&))%%,,Q/%%,,Q/!!((+=  Z(  	 Z( s$   =G	G#	G G #G:9G:c                s    \        V P                  V P                  V P                  V P                  4      pVw  V n        V n        V n        R # r   )cmpfilesr   r   r.   r   
same_files
diff_filesfunny_files)r   Zxx   & r   phase3Zdircmp.phase3   s7    diiT->->M=?:$*:r   c           	     sb   / V n         V P                   F  p\        P                  P	                  V P
                  V4      p\        P                  P	                  V P                  V4      pV P                  W#V P                  V P                  V P                  R 7      V P                   V&   K  	  R# ))r   N)subdirsr-   r	   r&   r0   r   r   Z	__class__r   r   r   )r   r4   Za_xZb_xs   &   r   phase4Zdircmp.phase4   s|    
 !!A'',,tyy!,C'',,tzz1-C#~~cTYY6:ll  .  DDLLO "r   c                s    V P                  4        V P                  P                  4        F  pVP                  4        K  	  R # r   )r=   r<   valuesphase4_closurer   Zsdr:   r   r?   Zdircmp.phase4_closure   s.    ,,%%'B (r   c                s   \        R V P                  V P                  4       V P                  '       d=   V P                  P	                  4        \        RV P                  RV P                  4       V P
                  '       d=   V P
                  P	                  4        \        RV P                  RV P
                  4       V P                  '       d1   V P                  P	                  4        \        RV P                  4       V P                  '       d1   V P                  P	                  4        \        RV P                  4       V P                  '       d1   V P                  P	                  4        \        RV P                  4       V P                  '       d1   V P                  P	                  4        \        RV P                  4       V P                  '       d3   V P                  P	                  4        \        RV P                  4       R# R# )	ZdiffzOnly inZ:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :N)printr   r   r*   r"   r+   r7   r8   r9   r-   r/   r#   r   r   reportZdircmp.report   sV   fdii,>>>NN!)TYYT^^<???OO  ")TZZdoo>???OO  "%t7???OO  "%t7!!#/1A1AB!!#+T-=-=>""$($*;*;< r   c                s    V P                  4        V P                  P                  4        F  p\        4        VP                  4        K  	  R # r   )rB   r<   r>   rA   r@   r:   r   report_partial_closureZdircmp.report_partial_closure   s0    ,,%%'BGIIK (r   c                s    V P                  4        V P                  P                  4        F  p\        4        VP	                  4        K  	  R # r   )rB   r<   r>   rA   report_full_closurer@   r:   r   rD   Zdircmp.report_full_closure   s3    ,,%%'BG""$ (r   )r<   r7   r8   r9   r-   r.   r/   r)   r*   r+   r    r!   c                s    WP                   9  d   \        V4      hV P                   V,          ! V 4       \        W4      # r   )	methodmapZAttributeErrorZgetattr)r   Zattr   &&r   __getattr__Zdircmp.__getattr__   s3    ~~% &&tT"t""r   )r)   r-   r.   r/   r8   r9   r   r   r   r    r*   r   r!   r+   r7   r   r<   )NN)__name__Z
__module__Z__qualname__Z__firstlineno____doc__r   r$   r,   r5   r;   r=   r?   rB   rC   rD   r%   rE   rG   Zclassmethodr   Z__class_getitem__Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   X   s     $	L S#,J@
D 
=2% V &6v!'f6"f%&	:I# $L1r   c                s    . . . 3pV Fc  p\         P                  P                  W4      p\         P                  P                  W4      pV\        WgV4      ,          P	                  V4       Ke  	  V# )a=  Compare common files in two directories.

a, b -- directory names
common -- list of file names found in both directories
shallow -- if true, do comparison based solely on stat() information

Returns a tuple of three lists:
  files that compare equal
  files that are different
  filenames that aren't regular files.

)r	   r&   r0   _cmpr3   )r   r   r)   r   Zresr4   ZaxZbxs   &&&&    r   r6   r6   	  s^     r2,CWW\\!WW\\!D!"))!,  Jr   c                 s\     V! V! WV4      4      '       * #   \         \        3 d     ^# i ; i)i   )r1   r2   )r   r   Zshabsr   s   &&&&&r   rJ   rJ   $  s2    s1}%%%Z  s    ++c                 s@    \        \        VP                  V 4      4      # r   )r'   r    r(   )ZflistZskiprF   r   r   r   -  s    D--u566r   c                  s*   ^ RI p ^ RIpVP                  V P                  R,          R4      w  r#\        V4      ^8w  d   VP	                  RR4      h\        V^ ,          V^,          4      pRV9   d   VP                  4        R# VP                  4        R# )i    N:i   NNZrzneed exactly two args)z-rZ )sysgetoptZargvr   ZGetoptErrorr   rD   rB   )rL   rM   ZoptionsZargsZdds        r   demorN   3  sr    MM#((2,4MG
4yA~  !8$??	Qa	!BW
 
		r   Z__main__)r   r   r   r6   r   i    )ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcsZ__pycache__)T)rI   r	   r
   Z	itertoolsr    Ztypesr   Z__all__r   r   r   r   r   r   r   r   r6   rK   rJ   r   rN   rH   r   r   r   <module>rO      s   
 
  ! 
I	
J&P
	n2 n2b6  7
 zF r   