Files
952-11/env/python/dll/Python312/Lib/__pycache__/filecmp.cpython-312.pyc
T

120 lines
14 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åf)ãó°—dZddlZddlZddlmZddlmZgd¢ZiZdZ gd¢Z
d„Z dd „Z d
„Z
d „ZGd „d
«Zdd„Zee fd„Zd„Zd„Zedk(re«yy)z³Utilities for comparing files and directories.
Classes:
dircmp
Functions:
cmp(f1, f2, shallow=True) -> int
cmpfiles(a, b, common) -> ([], [], [])
clear_cache()
éN)Ú filterfalse)Ú GenericAlias)Ú clear_cacheÚcmpÚdircmpÚcmpfilesÚDEFAULT_IGNORESi )ÚRCSÚCVSÚtagsz.gitz.hgz.bzrÚ_darcsÚ __pycache__có,—tj«y)zClear the filecmp cache.N)Ú_cacheÚclear©óúCC:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\filecmp.pyrrs €ä
‡L�L…Nrcó —ttj|««}ttj|««}|dtjk7s|dtjk7ry|r||k(ry|d|dk7rytj ||||f«}|€5t
||«}tt«dkDr
t«|t||||f<|S)aMCompare 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().
rFTééd) Ú_sigÚosÚstatÚS_IFREGrÚgetÚ_do_cmpÚlenr)Úf1Úf2ÚshallowÚs1Ús2Úoutcomes rrrs·€ô.
Œb�g‰g�b‹kÓ €BÜ
Œb�g‰g�b‹kÓ €BØ ˆ!�u”— ‘ Ò  1¡¬¯©Ò 5ØÙ�2˜’8ØØ ˆ!�u��1‘‚~Øä�j‰j˜"˜b " bÐ)Ó*€G؀ܘ"˜b“/ˆÜ Œv‹;˜Ò Ü ŒMØ!(Œˆr�2�r˜2ˆ~ÑØ €Nrcón—tj|j«|j|jfS©N)rÚS_IFMTÚst_modeÚst_sizeÚst_mtime)Ústs rrrFs*€Ü �K‰K˜Ÿ
™
Ó #Ø �J‰JØ �K‰Kð ðrcó"—t}t|d«5}t|d«5} |j|«}|j|«}||k7r ddd«ddd«y|s ddd«ddd«yŒN#1swYnxYwddd«y#1swYyxYw)NÚrbTF)ÚBUFSIZEÚopenÚread)rr ÚbufsizeÚfp1Úfp2Úb1Úb2s rrrKs“€Ü€GÜ
ˆb�$‹ð˜3¤ R¨£ð°#ØØ—‘˜'Ó"ˆBØ—‘˜'Ó"ˆBØ�RŠxØ÷ ÷ðñ Ø÷÷ðØ÷ðú÷÷ñús4“
B *A0Á
BÁA0ÁBÁ/A0Á0A9 Á5BÂBcóŒ—eZdZdZdd„Zd„Zd„Zd„Zd„Zd„Z d „Z
d
„Z d „Z d „Z
ee eeeeeeeeeee¬
« Zd„Zee«Zy)ra®A 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 instances (or MyDirCmp instances if this
object is of type MyDirCmp, a subclass of dircmp), keyed by names
in common_dirs.
Ncó¨—||_||_|€&tjtjg|_n||_|€ t |_y||_yr&)ÚleftÚrightrÚcurdirÚpardirÚhider Úignore)ÚselfÚaÚbr=r<s rÚ__init__zdircmp.__init__|sC€ØˆŒ ؈Œ
Ø ˆ<ÜŸ™¤B§I¡IÐ.ˆD�IàˆDŒIØ ˆ>Ü)ˆD�Kà ˆD�Krcó€—ttj|j«|j|j
z«|_ttj|j«|j|j
z«|_|j j«|jj«yr&)
Ú_filterrÚlistdirr8r<r=Ú left_listr9Ú
right_listÚsort©r>s rÚphase0z
dircmp.phase0ˆsx€Ü ¤§¡¨D¯I©IÓ!6Ø!%§¡¨4¯;©;Ñ!6ó8ˆŒä!¤"§*¡*¨T¯Z©ZÓ"8Ø"&§)¡)¨D¯K©KÑ"7ó9ˆŒà �‰×ÑÔØ �‰×ÑÕrc ó€—ttttjj
|j «|j ««}ttttjj
|j«|j««}tt|jt|j|«««|_ tt|jt|j|«««|_tt|jt|j|«««|_yr&)ÚdictÚzipÚmaprÚpathÚnormcaserErFÚlistÚ __getitem__ÚfilterÚ __contains__ÚcommonrÚ left_onlyÚ
right_only)r>r?r@s rÚphase1z
dircmp.phase1�s¼€Ü ””SœŸ™×)Ñ)¨4¯>©>Ó:¸D¿N¹NÓKÓ LˆÜ ””SœŸ™×)Ñ)¨4¯?©?Ó;¸T¿_¹_ÓMÓ NˆÜœ3˜qŸ}™}¬f°Q·^±^ÀQÓ.GÓHÓIˆŒ Üœc !§-¡-´¸Q¿^¹^ÈQÓ1OÓPÓQˆŒÜœs 1§=¡=´+¸a¿n¹nÈaÓ2PÓQÓRˆ�rcóš—g|_g|_g|_|jD�]‚}tj
j
|j|«}tj
j
|j|«}d} t j|«} t j|«}|ràtjj«}tjj«}||k7r|jj|«Œçtj|«r|jj|«�Œtj|«r|jj|«�ŒK|jj|«�Œh|jj|«�Œ…y#t$rd}Y�Œ%wxYw#t$rd}Y�Œ!wxYw)NTF)Ú common_dirsÚ common_filesÚ common_funnyrTrrNÚjoinr8r9rÚOSErrorr'r(ÚappendÚS_ISDIRÚS_ISREG) r>ÚxÚa_pathÚb_pathÚokÚa_statÚb_statÚa_typeÚb_types rÚphase2z
dircmp.phase2—s^€ØˆÔØˆÔØˆÔà—‘ó ,ˆAÜ—W‘W—\‘\ $§)¡)¨QÓ/ˆFÜ—W‘W—\‘\ $§*¡*¨aÓ0ˆFàˆBð
ÜŸ™ ›�ð
ÜŸ™ ›�ñ
ÜŸ™ V§^¡^Ó4�ÜŸ™ V§^¡^Ó4�ؘVÒ#Ø×%Ñ%×,Ñ,¨QÕ/Ü—\‘\ &Ô)Ø×$Ñ$×+Ñ+¨AÖ.Ü—\‘\ &Ô)Ø×%Ñ%×,Ñ,¨QÖ/à×%Ñ%×,Ñ,¨QÖ/à×!Ñ!×(Ñ(¨Ö+ñ9 ,øôò
à“ð
ûô
ò
à“ð
ús$Á=F)ÂF;Æ) F8Æ7F8Æ; G
Ç G
có„—t|j|j|j«}|\|_|_|_yr&)rr8r9rZÚ
same_filesÚ
diff_filesÚ funny_files)r>Úxxs rÚphase3z
dircmp.phase3ºs1€Ü
�d—i‘i §¡¨T×->Ñ->Ó
?ˆØ=?Ñ:ˆŒ˜œ¨$Õ*:rcóF—i|_|jD]‹}tjj |j
|«}tjj |j |«}|j|||j|j«|j|<Œ�yr&)
ÚsubdirsrYrrNr\r8r9Ú __class__r=r<)r>raÚa_xÚb_xs rÚphase4z
dircmp.phase4¾sv€ð
ˆŒ Ø×!Ñ!ò PˆAÜ—'‘'—,‘,˜tŸy™y¨!Ó,ˆCÜ—'‘'—,‘,˜tŸz™z¨1Ó-ˆCØ#Ÿ~™~¨c°3¸¿ ¹ ÀTÇYÁYÓOˆD�L‰L˜ŠOñ Prcó‚—|j«|jj«D]}|j«Œyr&)rurqÚvaluesÚphase4_closure©r>Úsds rrxzdircmp.phase4_closureÉs3€Ø � ‰ Œ
Ø—,‘,×%Ñ%Ó'ò ˆBØ × Ñ Õ ñ rcóÀ—td|j|j«|jr<|jj «td|jd|j«|j
r<|j
j «td|jd|j