U e5df&@sddlZddlZddlmZdddddgZiZdZd d d d d dddgZddZd!ddZ ddZ ddZ GdddZ d"ddZ ee fddZddZddZed kredS)#N) filterfalse clear_cachecmpdircmpcmpfilesDEFAULT_IGNORESi ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs __pycache__cCs tdSN)_cacheclearr r /usr/lib64/python3.8/filecmp.pyrsTcCstt|}tt|}|dtjks8|dtjkrt |r|j |n&t |r|j |n |j |q|j |qdS)Nrr) common_dirs common_files common_funnyrBrr<joinr(r)rOSErrorrrappendS_ISDIRS_ISREG) r.xZa_pathZb_pathokZa_statZwhyZb_statZa_typeZb_typer r r phase2s4     z dircmp.phase2cCs&t|j|j|j}|\|_|_|_dSr )rr(r)rG same_files diff_files funny_files)r.Zxxr r r phase3sz dircmp.phase3cCsNi|_|jD]<}tj|j|}tj|j|}t|||j|j |j|<q dSr ) subdirsrFrr<rIr(r)rr-r,)r.rNZa_xZb_xr r r phase4s  z dircmp.phase4cCs$||jD] }|qdSr )rVrUvaluesphase4_closurer.Zsdr r r rXszdircmp.phase4_closurecCstd|j|j|jr2|jtd|jd|j|jrT|jtd|jd|j|jrp|jtd|j|jr|jtd|j|jr|jtd|j|j r|j td|j |j r|j td|j dS) NZdiffzOnly in:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :) printr(r)rCr6rDrQrRrSrFrHr7r r r reports,           z dircmp.reportcCs*||jD]}t|qdSr )r\rUrWr[rYr r r report_partial_closureszdircmp.report_partial_closurecCs*||jD]}t|qdSr )r\rUrWr[report_full_closurerYr r r r^szdircmp.report_full_closure) rUrQrRrSrFrGrHrBrCrDr4r5cCs*||jkrt||j||t||Sr ) methodmapAttributeErrorgetattr)r.attrr r r __getattr__s zdircmp.__getattr__)NN)__name__ __module__ __qualname__r1r8rErPrTrVrXr\r]r^r9r_rcr r r r rVs0" # cCsJgggf}|D]6}tj||}tj||}|t||||q|Sr )rr<rI_cmprK)r/r0rBrresrNZaxZbxr r r rs cCs0z||||| WStk r*YdSXdS)N)rJ)r/r0Zshabsrr r r rgsrgcCstt|j|Sr )r>rrA)Zflistskipr r r r2sr2cCsrddl}ddl}||jddd\}}t|dkrB|ddt|d|d}d|krf|n|dS)Nrrrrizneed exactly two args)z-r)sysgetoptargvrZ GetoptErrorrr^r\)rnroZoptionsargsZddr r r demo$s   rr__main__)T)T)rr itertoolsr__all__r r"rrrrrrrrjrgr2rrrdr r r r  s4  ' %