Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \f&ã@s´dZddlZddlZddlmZdddddgZiZd#Zd d d dddddgZdd„Z d$dd„Z dd„Z dd„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|dtjkrdS|sdSqWWdQRXWdQRXdS)NÚrbFT)ÚBUFSIZEÚopenÚread)rrÚbufsizeÚfp1Úfp2Zb1Zb2r r r rIs  rc@sŠeZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„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  c Cs,y|||||ƒƒ Stk r&dSXdS)Né)rI)r/r0ZshÚabsrr r r rgsrgcCstt|j|ƒƒS)N)r=rr@)ÚflistÚ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Ú)rnro)ÚsysÚgetoptÚargvrZ GetoptErrorrr]r[)rprqZoptionsÚargsZddr r r Údemo$s   rtÚ__main__i )T)T)rfrrÚ itertoolsrÚ__all__r r"rrrrrrrrjrgr2rtrcr r r r Ú s&  ' %