选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
a ´i&Ïã@sndZddlZddlZddlZddlZddlZddlZzddlZ[dZWne y\dZYn0zddl Z [ dZ Wne y†dZ Yn0zddl Z [ dZ Wne y°dZ Yn0zddlmZWne yØdZYn0zddlmZWne �ydZYn0ejdkZdZZejdk�r,ddlZne�r:ddlZe�rDd nd Zeed ƒ�o^ej d ¡ae�oneed ƒZdZgd¢ZGdd„deƒZGdd„deƒZ Gdd„deƒZ!Gdd„deƒZ"Gdd„deƒZ#Gdd„de$ƒZ%Gdd„de$ƒZ&dd„Z'd d!„Z(efd"d#„Z)d¤d$d%„Z*d&d'„Z+d(d)„Z,d*d+„Z-dd,œd-d.„Z.dd,œd/d0„Z/eed1ƒ�rbdd,œd2d3„Z0nd4d3„Z0dd,œd5d6„Z1dd,œd7d8„Z2dd,œd9d:„Z3d;d<„Z4d¥d=d>„Z5dde3ddfd?d@„Z6eej7dAƒ�rÚdBdC„Z8dDdE„Z9ndFdC„Z8dGdE„Z9dHdI„Z:dJdK„Z;ejhej?k�o.ej@ejAv�o.ejejBvZCd¦dLdM„ZDeCeD_EdNdO„ZFe3fdPdQ„ZGdRdS„ZHdTdU„ZIdVdW„ZJdXdY„ZKd§d[d\„ZLd¨d]d^„ZMd_eLd`gdafiZNe�r¼eLdbgdcfeNdd<eMgdefeNdf<e �rÒeLdggdhfeNdi<e �rèeLdjgdkfeNdl<dmdn„ZOd©dpdq„ZPdrds„ZQdªdtdu„ZRdvdw„ZSdxdy„ZTd«dzd{„ZUd|d}„ZVd~d„ZWd€d�„ZXdd‚œdƒd„„ZYd…geYgdafd†geXgdefd‡œZZe�r„dˆd‰geYgdcfeZdd<e �rždŠd‹geYgdhfeZdi<e �r¸dŒd�geYgdkfeZdl<dŽd�„Z[d¬dd‚œd�d‘„Z\eed’ƒ�re ]d“¡e ^d”d•¡Z_d–e_j`_d—e_ja_d˜e_jb_d™d“„Zcn$e�r8e ]d“¡e ^d”d•¡Z_dšd“„Zcd­d›dœ„Zdd®dždŸ„Zed d¡„ZfejgejhBdfd¢d£„ZidS)¯z—Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. éNTF)Úgetpwnam)ÚgetgrnamÚntÚposixiiÚsendfileÚlinuxÚ _fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC)Ú copyfileobjÚcopyfileÚcopymodeÚcopystatÚcopyÚcopy2ÚcopytreeÚmoveÚrmtreeÚErrorÚSpecialFileErrorÚ ExecErrorÚ make_archiveÚget_archive_formatsÚregister_archive_formatÚunregister_archive_formatÚget_unpack_formatsÚregister_unpack_formatÚunregister_unpack_formatÚunpack_archiveÚignore_patternsÚchownÚwhichÚget_terminal_sizeÚ SameFileErrorc@s eZdZdS)rN)Ú__name__Ú __module__Ú __qualname__©r%r%ú/usr/lib64/python3.9/shutil.pyrEsrc@seZdZdZdS)r!z5Raised when source and destination are the same file.N©r"r#r$Ú__doc__r%r%r%r&r!Hsr!c@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)Nr'r%r%r%r&rKsrc@seZdZdZdS)rz+Raised when a command could not be executedNr'r%r%r%r&rOsrc@seZdZdZdS)Ú ReadErrorz%Raised when an archive cannot be readNr'r%r%r%r&r)Rsr)c@seZdZdZdS)Ú RegistryErrorzVRaised when a registry operation with the archiving and unpacking registries failsNr'r%r%r%r&r*Usr*c@seZdZdZdS)Ú_GiveupOnFastCopyzuRaised as a signal to fallback on using raw read()/write() file copy when fast-copy functions fail to do so. Nr'r%r%r%r&r+Ysr+c Cs°z| ¡}| ¡}Wn,ty@}zt|ƒ‚WYd}~n d}~00zt |||¡WnVtyª}z>|j|_|j|_|j t j t j hvr�t|ƒ‚n|d‚WYd}~n d}~00dS)zhCopy a regular file content or metadata by using high-performance fcopyfile(3) syscall (macOS). N) ÚfilenoÚ Exceptionr+rrÚOSErrorÚnameÚfilenameÚ filename2ÚerrnoÚEINVALÚENOTSUP)ÚfsrcÚfdstÚflagsÚinfdÚoutfdÚerrr%r%r&Ú_fastcopy_fcopyfile^s  r;c CsFz| ¡}| ¡}Wn,ty@}zt|ƒ‚WYd}~n d}~00ztt |¡jdƒ}Wntynd}Yn0tj dkr„t |dƒ}d}zt  ||||¡}WnŒt�y(}zr|j |_ |j |_|jtjkrÖdat|ƒ‚|jtjkrè|d‚|dk�rt |dtj¡dk�rt|ƒ‚|‚WYd}~qˆd}~00|dk�r8�qB||7}qˆdS)z˜Copy data from one regular mmap-like fd to another by using high-performance sendfile(2) syscall. This should work on Linux >= 2.6.33 only. Ni€ili@rF)r,r-r+ÚmaxÚosÚfstatÚst_sizer.ÚsysÚmaxsizeÚminrr/r0r1r2ÚENOTSOCKÚ_USE_CP_SENDFILEÚENOSPCÚlseekÚSEEK_CUR)r5r6r8r9r:Ú blocksizeÚoffsetÚsentr%r%r&Ú_fastcopy_sendfilers8         rKc Cs–|j}|j}tt|ƒƒ�j}||ƒ}|s*qtq||krj|d|…�}| |¡Wdƒqr1s^0Yq||ƒqWdƒn1sˆ0YdS)z–readinto()/memoryview() based variant of copyfileobj(). *fsrc* must support readinto() method and both files must be open in binary mode. N)ÚreadintoÚwriteÚ memoryviewÚ bytearray)r5r6ÚlengthÚ fsrc_readintoÚ fdst_writeÚmvÚnÚsmvr%r%r&Ú_copyfileobj_readinto²s*rVcCs0|st}|j}|j}||ƒ}|s"q,||ƒqdS)z=copy data from file-like object fsrc to file-like object fdstN)Ú COPY_BUFSIZEÚreadrM)r5r6rPÚ fsrc_readrRÚbufr%r%r&r Åsr cCs¢t|tjƒrHttjdƒrHztj | ¡t |¡¡WStyFYdS0ttjdƒrzztj ||¡WStyxYdS0tj  tj  |¡¡tj  tj  |¡¡kS)NÚsamestatFÚsamefile) Ú isinstancer=ÚDirEntryÚhasattrÚpathr[Ústatr.r\ÚnormcaseÚabspath©ÚsrcÚdstr%r%r&Ú _samefileÒs   ÿrgcCst|tjƒr| ¡St |¡S©N)r]r=r^ra©Úfnr%r%r&Ú_statäsrkcCs t|tjƒr| ¡Stj |¡Srh)r]r=r^Ú is_symlinkr`Úislinkrir%r%r&Ú_islinkçsrn©Úfollow_symlinksc Cs^t d||¡t||ƒr(td ||¡ƒ‚d}t||gƒD]h\}}z t|ƒ}Wnty^Yq80t  |j ¡rŽt |t j ƒr~|jn|}td|ƒ‚tr8|dkr8|j}q8|sÄt|ƒrÄt  t  |¡|¡�n–t|dƒ��x}�zt|dƒ��ú}t�r4z2t||tjƒ|WWdƒWWdƒSt�y0Yn0n�t�r€z.t||ƒ|WWdƒWWdƒSt�y|Yn0nDt�rÄ|dk�rÄt||t|tƒƒ|WdƒWWdƒSt ||ƒWdƒn1�sä0YWnHt!�y8} z.t j "|¡�s"t#d|›�ƒ| ‚n‚WYd} ~ n d} ~ 00Wdƒn1�sP0Y|S) zÎCopy data from src to dst in the most efficient way possible. If follow_symlinks is not set and src is a symbolic link, a new symlink will be created instead of copying the file it points to. zshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipeÚrbÚwbNzDirectory does not exist: )$r@Úauditrgr!ÚformatÚ enumeraterkr.raÚS_ISFIFOÚst_moder]r=r^r`rÚ_WINDOWSr?rnÚsymlinkÚreadlinkÚopenÚ_HAS_FCOPYFILEr;rÚ_COPYFILE_DATAr+rDrKrVrBrWr ÚIsADirectoryErrorÚexistsÚFileNotFoundError) rerfrpÚ file_sizeÚirjÚstr5r6Úer%r%r&r êsP       $ $".8r cCspt d||¡|sFt|ƒrFtj |¡rFttdƒr@tjtj}}qRdSn t tj }}||ƒ}||t   |j ¡ƒdS)zàCopy mode bits from src to dst. If follow_symlinks is not set, symlinks aren't followed if and only if both `src` and `dst` are symlinks. If `lchmod` isn't available (e.g. Linux) this method does nothing. zshutil.copymodeÚlchmodN)r@rsrnr=r`rmr_Úlstatr…rkÚchmodraÚS_IMODErw)rerfrpÚ stat_funcÚ chmod_funcrƒr%r%r&r *s  r Ú listxattrc CsÈztj||d�}Wn>tyP}z&|jtjtjtjfvr:‚WYd}~dSd}~00|D]l}z&tj|||d�}tj||||d�WqVtyÀ}z(|jtj tjtjtjfvr¬‚WYd}~qVd}~00qVdS)z®Copy extended filesystem attributes from `src` to `dst`. Overwrite existing attributes. If `follow_symlinks` is false, symlinks won't be followed. roN) r=r‹r.r2r4ÚENODATAr3ÚgetxattrÚsetxattrÚEPERM)rerfrpÚnamesr„r/Úvaluer%r%r&Ú _copyxattr@s ÿr’cOsdSrhr%)ÚargsÚkwargsr%r%r&r’Xsc s`t d||¡dddœdd„‰|p6t|ƒo4tj |¡ }|rJ‡fdd„}n ‡fdd„}t|tjƒrp|j|d �}n|d ƒ||d �}t  |j ¡}|d ƒ||j |j f|d�t |||d �z|d ƒ|||d �WntyÜYn0t|d ƒ�r\z|dƒ||j|d �WnXt�yZ}z>dD]*}tt|ƒ�r|jtt|ƒk�r�qF�q‚WYd}~n d}~00dS)aÛCopy file metadata Copy the permission bits, last access time, last modification time, and flags from `src` to `dst`. On Linux, copystat() also copies the "extended attributes" where possible. The file contents, owner, and group are unaffected. `src` and `dst` are path-like objects or path names given as strings. If the optional flag `follow_symlinks` is not set, symlinks aren't followed if and only if both `src` and `dst` are symlinks. zshutil.copystatN)ÚnsrpcWsdSrhr%)r•rpr“r%r%r&Ú_nopiszcopystat.._nopcs tt|ˆƒSrh)Úgetattrr=©r/©r–r%r&Úlookuppszcopystat..lookupcstt|ˆƒ}|tjvr|SˆSrh)r—r=Úsupports_follow_symlinks)r/rjr™r%r&ršus  roraÚutimer‡Úst_flagsÚchflags)Ú EOPNOTSUPPr4)r@rsrnr=r`rmr]r^rarˆrwÚ st_atime_nsÚ st_mtime_nsr’ÚNotImplementedErrorr_r�r.r2r—) rerfrpÚfollowršrƒÚmodeÚwhyr:r%r™r&r [s4    ÿ   r cCsBtj |¡r"tj |tj |¡¡}t|||d�t|||d�|S)a3Copy data and mode bits ("cp src dst"). Return the file's destination. The destination may be a directory. If follow_symlinks is false, symlinks won't be followed. This resembles GNU's "cp -P src dst". If source and destination are the same file, a SameFileError will be raised. ro)r=r`ÚisdirÚjoinÚbasenamer r ©rerfrpr%r%r&r �s r cCsBtj |¡r"tj |tj |¡¡}t|||d�t|||d�|S)a0Copy data and metadata. Return the file's destination. Metadata is copied with copystat(). Please see the copystat function for more information. The destination may be a directory. If follow_symlinks is false, symlinks won't be followed. This resembles GNU's "cp -P src dst". ro)r=r`r¦r§r¨r r r©r%r%r&r¯s rcs‡fdd„}|S)z�Function that can be used as copytree() ignore parameter. Patterns is a sequence of glob-style patterns that are used to exclude filescs(g}ˆD]}| t ||¡¡qt|ƒSrh)ÚextendÚfnmatchÚfilterÚset)r`r�Ú ignored_namesÚpattern©Úpatternsr%r&Ú_ignore_patternsÅsz)ignore_patterns.._ignore_patternsr%)r±r²r%r°r&rÀs rc CsD|dur$|t |¡dd„|Dƒƒ}ntƒ}tj||d�g} |tupJ|tu} |D�]‚} | j|vrbqPtj || j¡} tj || j¡} | rŠ| n| }zÖ|   ¡}|rÂtjdkrÂ| j dd�}|j t j krÂd}|�r8t  | ¡}|rôt || ¡t|| | d�nBtj |¡�s |�r WqP|  ¡�r,t|| ||||d�n ||| ƒn*|  ¡�rXt|| ||||d�n ||| ƒWqPt�yš}z|  |jd¡WYd}~qPd}~0t�yÒ}z |  | | t|ƒf¡WYd}~qPd}~00qPzt||ƒWnLt�y0}z2t|d dƒdu�r|  ||t|ƒf¡WYd}~n d}~00| �r@t| ƒ‚|S) NcSsg|] }|j‘qSr%r˜)Ú.0Úxr%r%r&Ú Ïóz_copytree..)Úexist_okrFro)Ú dirs_exist_okrÚwinerror)r=Úfspathr­Úmakedirsrr r/r`r§rlraÚst_reparse_tagÚIO_REPARSE_TAG_MOUNT_POINTrzryr rÚis_dirrrrªr“r.ÚappendÚstrr—)ÚentriesrerfÚsymlinksÚignoreÚ copy_functionÚignore_dangling_symlinksr¸r®ÚerrorsÚ use_srcentryÚsrcentryÚsrcnameÚdstnameÚsrcobjrlr†Úlinktor:r¥r%r%r&Ú _copytreeÌs^         ÿ   ÿ$,*rÍc CsXt d||¡t |¡�}t|ƒ}Wdƒn1s60Yt||||||||d�S)a'Recursively copy a directory tree and return the destination directory. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silence this exception. Notice that this has no effect on platforms that don't support os.symlink. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. If dirs_exist_ok is false (the default) and `dst` already exists, a `FileExistsError` is raised. If `dirs_exist_ok` is true, the copying operation will continue if it encounters existing directories, and files within the `dst` tree will be overwritten by corresponding files from the `src` tree. zshutil.copytreeN)rÁrerfrÂrÃrÄrÅr¸)r@rsr=ÚscandirÚlistrÍ) rerfrÂrÃrÄrÅr¸ÚitrrÁr%r%r&r s( & ýrÚst_file_attributescCsNz4|jdd�}t |j¡o2|jtj@o0|jtjk WStyHYdS0dS©NFro)raÚS_ISDIRrwrÑÚFILE_ATTRIBUTE_REPARSE_POINTr¼r½r.)Úentryrƒr%r%r&Ú _rmtree_isdirAs    þ rÖcCsJz0t |¡}t |j¡p.|jtj@o.|jtjkWSt yDYdS0dS)NF) r=r†raÚS_ISLNKrwrÑrÔr¼r½r.)r`rƒr%r%r&Ú_rmtree_islinkJs    þ rØcCs(z|jdd�WSty"YdS0dSrÒ)r¾r.)rÕr%r%r&rÖSs cCs tj |¡Srh)r=r`rm)r`r%r%r&rØYsc Cs2z6t |¡�}t|ƒ}Wdƒn1s*0YWn(ty^|tj|t ¡ƒg}Yn0|D]’}|j}t|ƒrÂz| ¡rˆtdƒ‚Wn*ty´|tjj |t ¡ƒYqdYn0t ||ƒqdzt  |¡Wqdtyô|tj |t ¡ƒYqd0qdzt  |¡Wn&t�y,|tj |t ¡ƒYn0dS)Nú%Cannot call rmtree on a symbolic link) r=rÎrÏr.r@Úexc_infor`rÖrlrmÚ_rmtree_unsafeÚunlinkÚrmdir)r`ÚonerrorÚ scandir_itrÁrÕÚfullnamer%r%r&rÛ]s0 *       rÛc Cs`z6t |¡�}t|ƒ}Wdƒn1s*0YWn>tyt}z&||_|tj|t ¡ƒWYd}~dSd}~00|D�]Þ}tj ||j ¡}z|j dd�}Wnty¶d}YnP0|�rz|j dd�} t   | j ¡}Wn*t�y|tj|t ¡ƒYqzYn0|�rztj|j tj|d�} d} Wn&t�yN|tj|t ¡ƒYnÎ0z¸tj | t | ¡¡�rÀt| ||ƒz"t | ¡d} tj|j |d�Wn&t�y¼|tj|t ¡ƒYn0n6z tdƒ‚Wn(t�yô|tjj|t ¡ƒYn0W| �st | ¡n| �st | ¡0qzztj|j |d�Wqzt�yX|tj|t ¡ƒYqz0qzdS)NFro)Údir_fdTrÙ)r=rÎrÏr.r0r@rÚr`r§r/r¾rarÓrwr†r{ÚO_RDONLYr[r>Ú_rmtree_safe_fdÚcloserÝrmrÜ) Útopfdr`rÞrßrÁr:rÕràr¾Úorig_stÚdirfdÚ dirfd_closedr%r%r&rã|s^ *         ÿrãc CsÐt d|¡|rdd„}n|dur*dd„}t�r€t|tƒrDt |¡}zt |¡}Wn&tyx|tj|t  ¡ƒYdS0zt  |tj ¡}d}Wn&ty¶|tj |t  ¡ƒYdS0z²tj   |t |¡¡�r"t|||ƒzt |¡d}t |¡Wn&t�y|tj|t  ¡ƒYn0n6z tdƒ‚Wn(t�yV|tj j|t  ¡ƒYn0W|�s~t |¡n|�s|t |¡0nLzt|ƒ�r”tdƒ‚Wn*t�yÀ|tj j|t  ¡ƒYdS0t||ƒSdS) aÄRecursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is platform and implementation dependent; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. z shutil.rmtreecWsdSrhr%©r“r%r%r&rÞÆszrmtree..onerrorNcWs‚dSrhr%rér%r%r&rÞÉsFTrÙ)r@rsÚ_use_fd_functionsr]Úbytesr=Úfsdecoder†r-rÚr{râr`r[r>rãrärÝr.rmrØrÛ)r`Ú ignore_errorsrÞræÚfdÚ fd_closedr%r%r&r¹sV          ÿ  rcCs0t |¡}tjjtjjpd}tj | |¡¡S)aHA basename() variant which first strips the trailing slash, if present. Thus we always get the last component of the path, even for directories. path: Union[PathLike, str] e.g. >>> os.path.basename('/bar/foo') 'foo' >>> os.path.basename('/bar/foo/') '' >>> _basename('/bar/foo/') 'foo' Ú)r=rºr`ÚsepÚaltsepr¨Úrstrip)r`rñr%r%r&Ú _basenameýs rôc CsRt d||¡|}tj |¡rbt||ƒr8t ||¡dStj |t|ƒ¡}tj  |¡rbt d|ƒ‚zt ||¡WnÚt �yLtj  |¡r°t  |¡}t ||¡t |¡n˜tj |¡�r4t||ƒrØt d||fƒ‚t|ƒ�s t |tj¡�st |¡�rtjdk�rtd||fƒ‚t|||dd�t|ƒn|||ƒt |¡Yn0|S) a+Recursively move a file or directory to another location. This is similar to the Unix "mv" command. Return the file or directory's destination. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics. If the destination is on our current filesystem, then rename() is used. Otherwise, src is copied to the destination and then removed. Symlinks are recreated under the new name if os.rename() fails because of cross filesystem renames. The optional `copy_function` argument is a callable that will be used to copy the source or it will be delegated to `copytree`. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. z shutil.moveNz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.ÚdarwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)rÄrÂ)r@rsr=r`r¦rgÚrenamer§rôrrr.rmrzryrÜÚ _destinsrcÚ _is_immutableÚaccessÚW_OKÚlistdirÚplatformÚPermissionErrorrr)rerfrÄÚreal_dstrÌr%r%r&rsL          ÿ  ÿÿþþÿ  rcCsVtj |¡}tj |¡}| tjj¡s2|tjj7}| tjj¡sL|tjj7}| |¡Srh)r=r`rcÚendswithrñÚ startswithrdr%r%r&r÷Qs    r÷cCs(t|ƒ}tjtjg}t|dƒo&|j|vS)Nr�)rkraÚ UF_IMMUTABLEÚ SF_IMMUTABLEr_r�)rerƒÚimmutable_statesr%r%r&røZs røcCsLtdus|durdSz t|ƒ}Wnty6d}Yn0|durH|dSdS)z"Returns a gid, given a group name.Né)rÚKeyError©r/Úresultr%r%r&Ú_get_gid_s   rcCsLtdus|durdSz t|ƒ}Wnty6d}Yn0|durH|dSdS)z"Returns an uid, given a user name.Nr)rrrr%r%r&Ú_get_uidks   r Úgzipcs(|durd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd |¡ƒ‚d dl} |rfd |nd} |d | } tj | ¡} | r´tj  | ¡s´|dur¦|  d | ¡|s´t  | ¡|durÆ|  d ¡t ˆƒ‰t ˆƒ‰‡‡‡‡fdd„} |�s$|  | d|¡}z|j|| d�W| ¡n | ¡0| S)aúCreate a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "bzip2", "xz", or None. 'owner' and 'group' can be used to define an owner and a group for the archive that is being built. If not provided, the current owner and group will be used. The output tar file will be named 'base_name' + ".tar", possibly plus the appropriate compression extension (".gz", ".bz2", or ".xz"). Returns the output filename. Nrðr ÚgzÚbzip2Úbz2ÚxzzCbad value for 'compress', or compression format not supported : {0}rÚ.ú.tarú creating %szCreating tar archivecs,ˆdurˆ|_ˆ|_ˆdur(ˆ|_ˆ|_|Srh)ÚgidÚgnameÚuidÚuname)Útarinfo©rÚgroupÚownerrr%r&Ú _set_uid_gid¦sz#_make_tarball.._set_uid_gidzw|%s©r¬)Ú_ZLIB_SUPPORTEDÚ_BZ2_SUPPORTEDÚ_LZMA_SUPPORTEDÚ ValueErrorrtÚtarfiler=r`ÚdirnamerÚinfor»r rr{Úaddrä)Ú base_nameÚbase_dirÚcompressÚverboseÚdry_runrrÚloggerÚtar_compressionr Ú compress_extÚ archive_nameÚ archive_dirrÚtarr%rr&Ú _make_tarballws>   ÿ      r/c Cs„ddl}|d}tj |¡}|rNtj |¡sN|dur@| d|¡|sNt |¡|durd| d||¡|�s€|j|d|jd��ò}tj  |¡} | tj kr´|  | | ¡|dur´| d| ¡t  |¡D] \} } } t | ƒD]:} tj  tj | | ¡¡} |  | | ¡|durÐ| d| ¡qÐ| D]L} tj  tj | | ¡¡} tj | ¡�r|  | | ¡|du�r| d| ¡�qq¾Wdƒn1�sv0Y|S) z¦Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Returns the name of the output zip file. rNú.ziprz#creating '%s' and adding '%s' to itÚw)Ú compressionz adding '%s')Úzipfiler=r`r!rr"r»ÚZipFileÚ ZIP_DEFLATEDÚnormpathÚcurdirrMÚwalkÚsortedr§Úisfile)r$r%r'r(r)r3Ú zip_filenamer-Úzfr`ÚdirpathÚdirnamesÚ filenamesr/r%r%r&Ú _make_zipfile¸sF   ÿÿ        2r@r.)r&Nzuncompressed tar file)r&r zgzip'ed tar-fileÚgztarzZIP fileÚzip)r&r zbzip2'ed tar-fileÚbztar)r&rzxz'ed tar-fileÚxztarcCsdd„t ¡Dƒ}| ¡|S)z‘Returns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description) cSsg|]\}}||df‘qS)rr%)r³r/Úregistryr%r%r&rµúr¶z'get_archive_formats..)Ú_ARCHIVE_FORMATSÚitemsÚsort©Úformatsr%r%r&rõs ÿrrðcCst|dur g}t|ƒs td|ƒ‚t|ttfƒs6tdƒ‚|D]&}t|ttfƒrXt|ƒdkr:tdƒ‚q:|||ft|<dS)auRegisters an archive format. name is the name of the format. function is the callable that will be used to create archives. If provided, extra_args is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be returned by the get_archive_formats() function. NzThe %s object is not callablez!extra_args needs to be a sequencerz+extra_args elements are : (arg_name, value))ÚcallableÚ TypeErrorr]ÚtuplerÏÚlenrF)r/ÚfunctionÚ extra_argsÚ descriptionÚelementr%r%r&rÿs   rcCs t|=dSrh)rFr˜r%r%r&rsrc  CsBt d||||¡t ¡} |durP|dur6| d|¡tj |¡}|sPt |¡|dur^tj}||dœ} z t |} Wn t y”t d|ƒd‚Yn0| d} | dD]\} }|| | <q¦|dkrÐ|| d <|| d <z@| ||fi| ¤Ž}W|du�r>|du�r| d | ¡t | ¡n,|du�r<|du�r2| d | ¡t | ¡0|S) aCreate an archive file (eg. zip or tar). 'base_name' is the name of the file to create, minus any format-specific extension; 'format' is the archive format: one of "zip", "tar", "gztar", "bztar", or "xztar". Or any other registered format. 'root_dir' is a directory that will be the root directory of the archive; ie. we typically chdir into 'root_dir' before creating the archive. 'base_dir' is the directory where we start archiving from; ie. 'base_dir' will be the common prefix of all files and directories in the archive. 'root_dir' and 'base_dir' both default to the current directory. Returns the name of the archive file. 'owner' and 'group' are used when creating a tar archive. By default, uses the current owner and group. zshutil.make_archiveNzchanging into '%s')r(r)zunknown archive format '%s'rérBrrzchanging back to '%s') r@rsr=ÚgetcwdÚdebugr`rcÚchdirr7rFrr)r$rtÚroot_dirr%r'r(rrr)Úsave_cwdr”Ú format_infoÚfuncÚargÚvalr0r%r%r&rs@           ý    rcCsdd„t ¡Dƒ}| ¡|S)z‘Returns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description) cSs"g|]\}}||d|df‘qS)rér%)r³r/r"r%r%r&rµUr¶z&get_unpack_formats..)Ú_UNPACK_FORMATSrGrHrIr%r%r&rOs ÿrc Csji}t ¡D]\}}|dD] }|||<qq |D]$}||vr0d}t||||fƒ‚q0t|ƒsftdƒ‚dS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)r^rGr*rKrL) Ú extensionsrOrPÚexisting_extensionsr/r"ÚextÚ extensionÚmsgr%r%r&Ú_check_unpack_optionsZs  ÿ rdcCs,|dur g}t|||ƒ||||ft|<dS)aMRegisters an unpack format. `name` is the name of the format. `extensions` is a list of extensions corresponding to the format. `function` is the callable that will be used to unpack archives. The callable will receive archives to unpack. If it's unable to handle an archive, it needs to raise a ReadError exception. If provided, `extra_args` is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be returned by the get_unpack_formats() function. N)rdr^)r/r_rOrPrQr%r%r&rls rcCs t|=dS)z*Removes the pack format from the registry.N)r^r˜r%r%r&r‚srcCs&tj |¡}tj |¡s"t |¡dS)z1Ensure that the parent directory of `path` existsN)r=r`r!r¦r»)r`r!r%r%r&Ú_ensure_directory†s  rec Csþddl}| |¡std|ƒ‚| |¡}zÆ| ¡D]°}|j}| d¡s2d|vrPq2tjj |g|  d¡¢RŽ}|spq2t |ƒ|  d¡s2|  |d¡�D}t |dƒ�}t||ƒWdƒn1sº0YWdƒq21sØ0Yq2W| ¡n | ¡0dS)z+Unpack zip `filename` to `extract_dir` rNz%s is not a zip fileú/z..Úrrr)r3Ú is_zipfiler)r4Úinfolistr0rr=r`r§Úsplitrerÿr{r rä) r0Ú extract_dirr3rBr"r/Ú targetpathÚsourceÚtargetr%r%r&Ú_unpack_zipfileŒs(     ÿJrorcCsbddl}z| |¡}Wn |jy6td|ƒ‚Yn0z|j||d�W| ¡n | ¡0dS)zAUnpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir` rNz/%s is not a compressed or uncompressed tar filer)r r{ÚTarErrorr)Ú extractallrä)r0rkr¬r Útarobjr%r%r&Ú_unpack_tarfileªsÿ rsrr0)r.rBz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t ¡D],\}}|dD]}| |¡r|SqqdS)Nr)r^rGrÿ)r0r/r"rbr%r%r&Ú_find_unpack_formatÉs   rtcCsþt d|||¡|dur t ¡}t |¡}t |¡}|durBi}nd|i}|durªz t|}Wn"ty€td |¡ƒd‚Yn0|d}|||fit |dƒ¤|¤ŽnPt |ƒ}|durÈt d |¡ƒ‚t|d}t t|dƒ|B}|||fi|¤ŽdS)a]Unpack an archive. `filename` is the name of the archive. `extract_dir` is the name of the target directory, where the archive is unpacked. If not provided, the current working directory is used. `format` is the archive format: one of "zip", "tar", "gztar", "bztar", or "xztar". Or any other registered format. If not provided, unpack_archive will use the filename extension and see if an unpacker was registered for that extension. In case none is found, a ValueError is raised. If `filter` is given, it is passed to the underlying extraction function. zshutil.unpack_archiveNr¬zUnknown unpack format '{0}'rSrzUnknown archive format '{0}') r@rsr=rTrºr^rrrtÚdictrtr))r0rkrtr¬Ú filter_kwargsrYrZr”r%r%r&rÐs*      rÚstatvfsÚ disk_usageÚusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t |¡}|j|j}|j|j}|j|j|j}t|||ƒS)zÖReturn disk usage statistics about the given path. Returned value is a named tuple with attributes 'total', 'used' and 'free', which are the amount of total, used and free space, in bytes. )r=rwÚf_bavailÚf_frsizeÚf_blocksÚf_bfreeÚ_ntuple_diskusage)r`rƒÚfreeÚtotalÚusedr%r%r&rx s    cCs"t |¡\}}||}t|||ƒS)z×Return disk usage statistics about the given path. Returned values is a named tuple with attributes 'total', 'used' and 'free', which are the amount of total, used and free space, in bytes. )rZ _getdiskusager~)r`r€rr�r%r%r&rxscCs®t d|||¡|dur(|dur(tdƒ‚|}|}|dur>d}n(t|tƒrft|ƒ}|durftd |¡ƒ‚|durtd}n(t|tƒsœt |ƒ}|durœtd |¡ƒ‚t   |||¡dS)z¹Change owner user and group of the given path. user and group can be the uid/gid or the user/group names, and in that case, they are converted to their respective uid/gid. z shutil.chownNzuser and/or group must be setéÿÿÿÿzno such user: {!r}zno such group: {!r}) r@rsrr]rÀr Ú LookupErrorrtÚintrr=r)r`ÚuserrÚ_userÚ_groupr%r%r&r%s$  r©éPéc CsÎzttjdƒ}Wnttfy,d}Yn0zttjdƒ}WnttfyZd}Yn0|dksl|dkrÀzt tj ¡¡}Wn"t tt fy¢t  |¡}Yn0|dkr²|j }|dkrÀ|j }t  ||f¡S)aGet the size of the terminal window. For each of the two dimensions, the environment variable, COLUMNS and LINES respectively, is checked. If the variable is defined and the value is a positive integer, it is used. When COLUMNS or LINES is not defined, which is the common case, the terminal connected to sys.__stdout__ is queried by invoking os.get_terminal_size. If the terminal size cannot be successfully queried, either because the system doesn't support querying, or because we are not connected to a terminal, the value given in fallback parameter is used. Fallback defaults to (80, 24) which is the default size used by many terminal emulators. The value returned is a named tuple of type os.terminal_size. ÚCOLUMNSrÚLINES)r„r=Úenvironrrr r@Ú __stdout__r,ÚAttributeErrorr.Ú terminal_sizeÚcolumnsÚlines)Úfallbackr‘r’Úsizer%r%r&r Es$  r cCs&tj |¡o$t ||¡o$tj |¡ Srh)r=r`rrùr¦)rjr¤r%r%r&Ú _access_checkvs ÿr•c sÀtj ˆ¡rtˆ|ƒrˆSdStˆtƒ}|durrtj dd¡}|durrzt d¡}Wnt t fyptj }Yn0|szdS|rœt  |¡}|  t  tj¡¡}nt |¡}|  tj¡}tjdk�rRtj}|rÒt  |¡}||vræ| d|¡t d¡pòt}dd„|  tj¡Dƒ}|�rd d„|Dƒ}t‡fd d „|Dƒƒ�r>ˆg}n‡fd d„|Dƒ}nˆg}tƒ}|D]X} tj | ¡} | |v�rb| | ¡|D],} tj | | ¡} t| |ƒ�rŠ| S�qŠ�qbdS) a3Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. NÚPATHÚCS_PATHÚwin32rÚPATHEXTcSsg|] }|r|‘qSr%r%©r³rar%r%r&rµ¯r¶zwhich..cSsg|]}t |¡‘qSr%)r=Úfsencoderšr%r%r&rµ²r¶c3s |]}ˆ ¡ | ¡¡VqdSrh)Úlowerrÿrš©Úcmdr%r&Ú ·r¶zwhich..csg|] }ˆ|‘qSr%r%ršr�r%r&rµºr¶)r=r`r!r•r]rër�ÚgetÚconfstrr�rÚdefpathr›rjÚpathseprìr@rür7ÚinsertÚgetenvÚ_WIN_DEFAULT_PATHEXTÚanyr­rbr#r§) ržr¤r`Ú use_bytesr7Úpathext_sourceÚpathextÚfilesÚseenÚdirÚnormdirÚthefiler/r%r�r&r{sV              r)r)F)FN)r rrNNN)rrN)Nrð)NNrrNNN)Nrð)NN)NN)rˆ)jr(r=r@rar«Ú collectionsr2ÚzlibrÚ ImportErrorr rÚlzmarÚpwdrÚgrprr/rxrrrWr_rürrDr|r¦Ú__all__r.rr!rrr)r-r*r+r;rKrVr rgrkrnr r r’r r rrrÍrÚ stat_resultrÖrØrÛrãr{rÜrÝÚsupports_dir_fdrÎÚ supports_fdr›rêrÚavoids_symlink_attacksrôrr÷rørr r/r@rFrrrrrrdrrrerorsr^rtrr¿Ú namedtupler~r€r�rrxrr r•ÚF_OKÚX_OKrr%r%r%r&Ús>             @  @ B ÿ Aÿ 0 8ÿ þ ý B B   ÿ A - ÿÿÿÿ ÿ 8 ÿ   þ ÿ ÿ ÿ1       1