Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβ€”the ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβ€”embodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.🌌 SpectraShell

🌌 SpectraShell

Current path: lib64/python3.6/__pycache__/



⬆️ Go up: /lib64/python3.6

πŸ“„ Viewing: filecmp.cpython-36.pyc

3


 \f&οΏ½@sοΏ½dZddlZddlZddlmZdddddgZiZd#Zddd
dddddgZddοΏ½Z	d$ddοΏ½Z
ddοΏ½ZddοΏ½ZGddοΏ½dοΏ½Z
d%ddοΏ½Zee
fddοΏ½ZddοΏ½Zd d!οΏ½Zed"krοΏ½eοΏ½dS)&zοΏ½Utilities for comparing files and directories.

Classes:
    dircmp

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

οΏ½N)οΏ½filterfalseοΏ½clear_cacheοΏ½cmpοΏ½dircmpοΏ½cmpfilesοΏ½DEFAULT_IGNORESοΏ½iZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcsοΏ½__pycache__cCstjοΏ½dS)zClear the filecmp cache.N)οΏ½_cacheοΏ½clearοΏ½rrοΏ½/usr/lib64/python3.6/filecmp.pyrsTcCsοΏ½ttj|οΏ½οΏ½}ttj|οΏ½οΏ½}|dtjks8|dtjkr<dS|rL||krLdS|d|dkr`dStj||||fοΏ½}|dkrοΏ½t||οΏ½}ttοΏ½dkrοΏ½tοΏ½|t||||f<|S)aοΏ½Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to 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().

    rFTοΏ½NοΏ½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
rDs
rcCsbt}t|dοΏ½οΏ½J}t|dοΏ½οΏ½4}x,|j|οΏ½}|j|οΏ½}||kr>dS|sdSqWWdQRXWdQRXdS)NοΏ½rbFT)οΏ½BUFSIZEοΏ½openοΏ½read)rrοΏ½bufsizeοΏ½fp1οΏ½fp2Zb1Zb2rrr
rIs

rc@sοΏ½eZdZdZdddοΏ½ZddοΏ½ZddοΏ½Zd	d
οΏ½ZddοΏ½Zd
dοΏ½Z	ddοΏ½Z
ddοΏ½ZddοΏ½ZddοΏ½Z
ee	eeeeeeeeeeedοΏ½ZddοΏ½ZdS)raMA class that manages the comparison of 2 directories.

    dircmp(a, b, ignore=None, hide=None)
      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].

    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 objects, keyed by names in common_dirs.
     NcCsD||_||_|dkr$tjtjg|_n||_|dkr:t|_n||_dS)N)οΏ½leftοΏ½rightrοΏ½curdirοΏ½pardirοΏ½hiderοΏ½ignore)οΏ½selfοΏ½aοΏ½br-r,rrr
οΏ½__init__xszdircmp.__init__cCsPttj|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|_οΏ½x |jDοΏ½]}tjj|j|οΏ½}tjj|j|οΏ½}d}ytj	|οΏ½}Wn&t
k
rz}z
d}WYdd}~XnXytj	|οΏ½}Wn&t
k
rοΏ½}z
d}WYdd}~XnX|οΏ½r&t	j|jοΏ½}t	j|jοΏ½}	||	krοΏ½|jj
|οΏ½n>t	j|οΏ½rοΏ½|jj
|οΏ½n&t	j|οΏ½οΏ½r|jj
|οΏ½n|jj
|οΏ½q|jj
|οΏ½qWdS)Nrr)οΏ½common_dirsοΏ½common_filesοΏ½common_funnyrArr;οΏ½joinr(r)rοΏ½OSErrorrrοΏ½appendοΏ½S_ISDIRοΏ½S_ISREG)
r.οΏ½xZa_pathZb_pathοΏ½okZa_statZwhyZb_statZa_typeZb_typerrr
οΏ½phase2οΏ½s4
z
dircmp.phase2cCs&t|j|j|jοΏ½}|\|_|_|_dS)N)rr(r)rFοΏ½
same_filesοΏ½
diff_filesοΏ½funny_files)r.Zxxrrr
οΏ½phase3οΏ½sz
dircmp.phase3cCsRi|_xF|jD]<}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.phase4cCs(|jοΏ½x|jjοΏ½D]}|jοΏ½qWdS)N)rUrTοΏ½valuesοΏ½phase4_closure)r.οΏ½sdrrr
rWοΏ½szdircmp.phase4_closurecCsοΏ½td|j|jοΏ½|jr2|jjοΏ½td|jd|jοΏ½|jrT|jjοΏ½td|jd|jοΏ½|jrp|jjοΏ½td|jοΏ½|jrοΏ½|jjοΏ½td|jοΏ½|jrοΏ½|jjοΏ½td|jοΏ½|j	rοΏ½|j	jοΏ½td|j	οΏ½|j
rοΏ½|j
jοΏ½td|j
οΏ½dS)	NZdiffzOnly inοΏ½:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)οΏ½printr(r)rBr6rCrPrQrRrErG)r.rrr
οΏ½reportοΏ½s,






z
dircmp.reportcCs.|jοΏ½x |jjοΏ½D]}tοΏ½|jοΏ½qWdS)N)r[rTrVrZ)r.rXrrr
οΏ½report_partial_closureοΏ½szdircmp.report_partial_closurecCs.|jοΏ½x |jjοΏ½D]}tοΏ½|jοΏ½qWdS)N)r[rTrVrZοΏ½report_full_closure)r.rXrrr
r]οΏ½szdircmp.report_full_closure)rTrPrQrRrErFrGrArBrCr4r5cCs*||jkrt|οΏ½οΏ½|j||οΏ½t||οΏ½S)N)οΏ½	methodmapοΏ½AttributeErrorοΏ½getattr)r.οΏ½attrrrr
οΏ½__getattr__οΏ½s
zdircmp.__getattr__)NN)οΏ½__name__οΏ½
__module__οΏ½__qualname__οΏ½__doc__r1r7rDrOrSrUrWr[r\r]r8r^rbrrrr
rVs" 
#

cCsNgggf}x>|D]6}tjj||οΏ½}tjj||οΏ½}|t|||οΏ½j|οΏ½qW|S)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.

    )rr;rHοΏ½_cmprJ)r/r0rArοΏ½resrMZaxZbxrrr
rοΏ½s

cCs,y|||||οΏ½οΏ½Stk
r&dSXdS)NοΏ½)rI)r/r0ZshοΏ½absrrrr
rgsrgcCstt|j|οΏ½οΏ½S)N)r=rr@)ZflistοΏ½skiprrr
r2sr2cCsrddl}ddl}|j|jddοΏ½dοΏ½\}}t|οΏ½dkrB|jddοΏ½οΏ½t|d|dοΏ½}d|krf|jοΏ½n|jοΏ½dS)	NrrοΏ½rrizneed exactly two argsοΏ½-rοΏ½)rmrn)οΏ½sysοΏ½getoptοΏ½argvrZGetoptErrorrr]r[)rorpZoptionsοΏ½argsZddrrr
οΏ½demo$s
rsοΏ½__main__i )T)T)rfrrοΏ½	itertoolsrοΏ½__all__r
r"rrrrrrrrjrgr2rsrcrrrr
οΏ½<module>s&
'
%
	


πŸ“