grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026î   ff&ã@sdZddlZddlZddlmZdddddgZiZd#Zd d d dddddgZdd„Z ddd„Z dd„Z dd„Z Gdd„dƒZ ddd„Zee dd„Zdd„Zd d!„Zed"kreƒndS)$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__cCstjƒdS)zClear the filecmp cache.N)Ú_cacheÚclear©r r ú,/opt/alt/python34/lib64/python3.4/filecmp.pyrsTcCsñttj|ƒƒ}ttj|ƒƒ}|dtjksP|dtjkrTdS|rj||krjdS|d|dkr‚dStj||||fƒ}|dkrít||ƒ}ttƒdkrÔtƒn|t||||f 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||_||_|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¡}z d}WYdd}~XnXytj |ƒ}Wn+t k râ}z d}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_statZwhyZb_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| s$   '  ¤