+
    lh)                         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                 .    \         P                  4        R# )zClear the filecmp cache.N)_cacheclear     lib/python3.14/filecmp.pyclear_cacher      s    
LLNr	   c                   \        \        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statS_IFREGr   get_do_cmplenr   )f1f2shallows1s2outcomes   &&&   r
   cmpr      s    . 
bggbk	B	bggbk	B	!u1 528	!u1~jj"")*G"/v;M!(rr~Nr	   c                 p    \         P                  ! V P                  4      V P                  V P                  3# N)r   S_IFMTst_modest_sizest_mtime)sts   &r
   r   r   F   s*    KK

#JJKK r	   c           	      v   \         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)rbTNF)BUFSIZEopenread)r   r   bufsizefp1fp2b1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                      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                   Wn         W n        Vf'   \        P                  \        P                  .V n        MW@n        Vf   \        V n        MW0n        WPn        R # r   )	leftrightr   curdirpardirhideDEFAULT_IGNORESignorer   )selfabr4   r2   r   s   &&&&&$r
   __init__dircmp.__init__   s@    	
<BII.DII>)DK Kr	   c                   \        \        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   listdirr.   r2   r4   	left_listr/   
right_listsortr5   s   &r
   phase0dircmp.phase0   sx     DII!6!%4;;!68!"**TZZ"8"&))DKK"79r	   c           	        \        \        \        \        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   )dictzipmapr   pathnormcaser=   r>   list__getitem__filter__contains__commonr   	left_only
right_only)r5   r6   r7   s   &  r
   phase1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                   . 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_funnyrM   r   rG   joinr.   r/   r   OSError
ValueErrorr   r   appendS_ISDIRS_ISREG)	r5   xa_pathb_pathoka_statb_stata_typeb_types	   &        r
   phase2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                    \        V P                  V P                  V P                  V P                  4      pVw  V n        V n        V n        R # r   )cmpfilesr.   r/   rT   r   
same_files
diff_filesfunny_files)r5   xxs   & r
   phase3dircmp.phase3   s7    diiT->->M=?:$*:r	   c           	     b   / 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)subdirsrS   r   rG   rV   r.   r/   	__class__r4   r2   r   )r5   r\   a_xb_xs   &   r
   phase4dircmp.phase4   s|    
 !!A'',,tyy!,C'',,tzz1-C#~~cTYY6:ll  .  DDLLO "r	   c                    V P                  4        V P                  P                  4        F  pVP                  4        K  	  R # r   )rs   ro   valuesphase4_closurer5   sds   & r
   rw   dircmp.phase4_closure   s.    ,,%%'B (r	   c                   \        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# )	diffzOnly in:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :N)printr.   r/   rN   r?   rO   rh   ri   rj   rS   rU   r@   s   &r
   reportdircmp.report   sV   fdii,>>>NN!)TYYT^^<???OO  ")TZZdoo>???OO  "%t7???OO  "%t7!!#/1A1AB!!#+T-=-=>""$($*;*;< r	   c                    V P                  4        V P                  P                  4        F  p\        4        VP                  4        K  	  R # r   )r   ro   rv   r~   rx   s   & r
   report_partial_closuredircmp.report_partial_closure   s0    ,,%%'BGIIK (r	   c                    V P                  4        V P                  P                  4        F  p\        4        VP	                  4        K  	  R # r   )r   ro   rv   r~   report_full_closurerx   s   & r
   r   dircmp.report_full_closure   s3    ,,%%'BG""$ (r	   )ro   rh   ri   rj   rS   rT   rU   rM   rN   rO   r=   r>   c                    WP                   9  d   \        V4      hV P                   V,          ! V 4       \        W4      # r   )	methodmapAttributeErrorgetattr)r5   attrs   &&r
   __getattr__dircmp.__getattr__   s3    ~~% &&tT"t""r	   )rM   rS   rT   rU   ri   rj   r2   r4   r.   r=   rN   r/   r>   rO   rh   r   ro   )NN)__name__
__module____qualname____firstlineno____doc__r8   rA   rP   rd   rl   rs   rw   r   r   r   rD   r   r   classmethodr   __class_getitem____static_attributes____classdictcell__)__classdict__s   @r
   r   r   X   s     $	L S#,J@
D 
=2% V &6v!'f6"f%&	:I# $L1r	   c                    . . . 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   rG   rV   _cmprY   )r6   r7   rM   r   resr\   axbxs   &&&&    r
   rg   rg   	  s^     r2,CWW\\!WW\\!D!"))!,  Jr	   c                 \     V! V! WV4      4      '       * #   \         \        3 d     ^# i ; i)   )rW   rX   )r6   r7   shabsr   s   &&&&&r
   r   r   $  s2    s1}%%%Z  s    ++c                 @    \        \        VP                  V 4      4      # r   )rI   r   rL   )flistskips   &&r
   r;   r;   -  s    D--u566r	   c                  *   ^ 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# )    N:   NNrzneed exactly two args)z-r )sysgetoptargvr   GetoptErrorr   r   r   )r   r   optionsargsdds        r
   demor   3  sr    MM#((2,4MG
4yA~  !8$??	Qa	!BW
 
		r	   __main__)r   r   r   rg   r3   i    )RCSCVStagsz.gitz.hgz.bzr_darcs__pycache__)T)r   r   r   	itertoolsr   typesr   __all__r   r$   r3   r   r   r   r   r   rg   r   r   r;   r   r   r   r	   r
   <module>r      s   
 
  ! 
I	
J&P
	n2 n2b6  7
 zF r	   