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 N”ªj}ŸãA@s¼dZddlZddlZddlZddlZddlZddlZyddlZ[dZWne k r^dZYnXyddl Z [ dZ Wne k rŠdZ YnXyddl Z [ dZ Wne k r¶dZ YnXyddlmZWne k ràdZYnXyddlmZWne k �r dZYnXddd d d d d ddddddddddddddddddgZGd d„deƒZGd!d„deƒZGd"d„deƒZGd#d„deƒZGd$d%„d%eƒZGd&d'„d'eƒZd†d*d„Zd+d,„Zdd-œd.d„Zdd-œd/d „Zeed0ƒ�rîdd-œd1d2„Z nd3d2„Z dd-œd4d „Z!dd-œd5d „Z"dd-œd6d „Z#d7d„Z$dde#dfd8d „Z%d9d:„Z&d;d<„Z'ej(ejej)ej*hej+k�o~ej,ej-k�o~ejej.kZ/d‡d=d„Z0e/e0_1d>d?„Z2e#fd@d„Z3dAdB„Z4dCdD„Z5dEdF„Z6dˆdHdI„Z7d‰dJdK„Z8dLe7dŠgdNfiZ9e�re7d‹gdOfe9dP<e8gdQfe9dR<e �re7dŒgdTfe9dU<e �r0e7d�gdWfe9dX<dYd„Z:dŽd[d„Z;d\d„Zd_d`„Z?d�dad„Z@dbd„ZAdcdd„ZBdedf„ZCddgœdhdi„ZDdjgeDgdNfdkgeCgdQfdlœZEe�rÌdmdngeDgdOfeEdP<e �rædodpgeDgdTfeEdU<e �rdqdrgeDgdWfeEdX<dsdt„ZFd‘ddgœdud„ZGeedvƒ�r\ejHdwƒejIdxdyƒZJdzeJjK_d{eJjL_d|eJjM_d}dw„ZNn2ejOd~k�rŽddlPZPejHdwƒejIdxdyƒZJddw„ZNd’d€d„ZQd”dƒd„ZRejSejTBdfd„d„ZUdS)•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Ú 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)r N)Ú__name__Ú __module__Ú __qualname__©r r ú/usr/lib64/python3.6/shutil.pyr 7sc@seZdZdZdS)rz5Raised when source and destination are the same file.N)rrrÚ__doc__r r r r!r:sc@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)N)rrrr"r r r r!r=sc@seZdZdZdS)rz+Raised when a command could not be executedN)rrrr"r r r r!rAsc@seZdZdZdS)Ú ReadErrorz%Raised when an archive cannot be readN)rrrr"r r r r!r#Dsr#c@seZdZdZdS)Ú RegistryErrorzVRaised when a registry operation with the archiving and unpacking registries failsN)rrrr"r r r r!r$Gsr$éicCs$x|j|ƒ}|sP|j|ƒqWdS)z=copy data from file-like object fsrc to file-like object fdstN)ÚreadÚwrite)ÚfsrcÚfdstZlengthZbufr r r!rLs  c CsXttjdƒr0ytjj||ƒStk r.dSXtjjtjj|ƒƒtjjtjj|ƒƒkS)NÚsamefileF)ÚhasattrÚosÚpathr*ÚOSErrorÚnormcaseÚabspath)ÚsrcÚdstr r r!Ú _samefileTs r3)Úfollow_symlinkscCsÈt||ƒrtdj||ƒƒ‚xL||gD]@}ytj|ƒ}Wntk rJYq$Xtj|jƒr$td|ƒ‚q$W| rŽtj j |ƒrŽtj tj |ƒ|ƒn6t |dƒ�&}t |dƒ�}t||ƒWdQRXWdQRX|S)z«Copy data from src to dst. 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. z{!r} and {!r} are the same filez`%s` is a named pipeÚrbÚwbN)r3rÚformatr,Ústatr.ÚS_ISFIFOÚst_moderr-ÚislinkÚsymlinkÚreadlinkÚopenr)r1r2r4ÚfnÚstr(r)r r r!r`s    cCsz| r>tjj|ƒr>tjj|ƒr>ttdƒr8tjtj}}q\dSnttdƒrXtjtj}}ndS||ƒ}||tj|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. ÚlchmodNÚchmod) r,r-r;r+ÚlstatrAr8rBÚS_IMODEr:)r1r2r4Z stat_funcZ chmod_funcr@r r r!r}s  Ú listxattrcCs¼ytj||d�}Wn4tk rF}z|jtjtjfkr8‚dSd}~XnXxn|D]f}y&tj|||d�}tj||||d�WqNtk r²}z|jtjtjtjfkr¢‚WYdd}~XqNXqNWdS)z®Copy extended filesystem attributes from `src` to `dst`. Overwrite existing attributes. If `follow_symlinks` is false, symlinks won't be followed. )r4N) r,rEr.ÚerrnoÚENOTSUPZENODATAÚgetxattrÚsetxattrZEPERM)r1r2r4ÚnamesÚeÚnameÚvaluer r r!Ú _copyxattr“s  rNcOsdS)Nr )ÚargsÚkwargsr r r!rNªsc s6dddœdd„‰|p,tjj|ƒo*tjj|ƒ }|r@‡fdd„}n ‡fdd„}|dƒ||d �}tj|jƒ}|d ƒ||j|jf|d�y|d ƒ|||d �Wntk r¬YnXt |d ƒ�r$y|d ƒ||j |d �WnPt k �r"}z2x*dD] }t t |ƒrì|j t t |ƒkrìPqìW‚WYdd}~XnXt|||d �dS)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 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. N)Únsr4cWsdS)Nr )rQr4rOr r r!Ú_nop¸szcopystat.._nopcs tt|ˆƒS)N)Úgetattrr,)rL)rRr r!Úlookup¿szcopystat..lookupcstt|ˆƒ}|tjkr|SˆS)N)rSr,Úsupports_follow_symlinks)rLr?)rRr r!rTÄs  r8)r4ÚutimerBÚst_flagsZchflagsÚ EOPNOTSUPPrG)rXrG)r,r-r;r8rDr:Ú st_atime_nsÚ st_mtime_nsÚNotImplementedErrorr+rWr.rFrSrN) r1r2r4ZfollowrTr@ÚmodeÚwhyÚerrr )rRr!r­s,      cCsBtjj|ƒr"tjj|tjj|ƒƒ}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. )r4)r,r-ÚisdirÚjoinÚbasenamerr)r1r2r4r r r!rçs cCsBtjj|ƒr"tjj|tjj|ƒƒ}t|||d�t|||d�|S)a1Copy 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". )r4)r,r-r_r`rarr)r1r2r4r r r!r ùs cs‡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}xˆD]}|jtj||ƒƒq Wt|ƒS)N)ÚextendÚfnmatchÚfilterÚset)r-rJÚ ignored_namesÚpattern)Úpatternsr r!Ú_ignore_patternss z)ignore_patterns.._ignore_patternsr )rhrir )rhr!r s cCsätj|ƒ}|dk r|||ƒ}ntƒ}tj|ƒg}�xB|D�]8} | |krJq:tjj|| ƒ} tjj|| ƒ} y¢tjj| ƒrÞtj| ƒ} |r tj| | ƒt | | | d�n 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. N)r4rZwinerror)r,ÚlistdirreÚmakedirsr-r`r;r=r<rÚexistsr_r r rbrOr.ÚappendÚstrrS)r1r2ÚsymlinksÚignoreÚ copy_functionZignore_dangling_symlinksrJrfÚerrorsrLZsrcnameZdstnameÚlinktor^r]r r r!r sL$           *&c$CsLytjj|ƒrtdƒ‚Wn(tk r@|tjj|tjƒƒdSXg}ytj|ƒ}Wn&tk rz|tj|tjƒƒYnXx’|D]Š}tjj||ƒ}ytj|ƒj }Wntk r¼d}YnXt j |ƒrÔt ||ƒq‚ytj |ƒWq‚tk �r |tj |tjƒƒYq‚Xq‚Wytj|ƒWn(tk �rF|tj|tjƒƒYnXdS)Nz%Cannot call rmtree on a symbolic linkr)r,r-r;r.ÚsysÚexc_inforjr`rCr:r8ÚS_ISDIRÚ_rmtree_unsafeÚunlinkÚrmdir)r-ÚonerrorrJrLÚfullnamer\r r r!rwqs6      rwc 0CsØg}ytj|ƒ}Wn:tk rL}z||_|tj|tjƒƒWYdd}~XnX�x‚|D�]x}tjj||ƒ}ytj||dd�}|j }Wntk rœd}YnXtj |ƒ�r”ytj |tj |d�} Wn&tk ræ|tj |tjƒƒYn¬Xzœtjj |tj| ƒƒ�rJt| ||ƒytj||d�Wn(tk �rF|tj|tjƒƒYnXn8y tdƒ‚Wn*tk �r€|tjj|tjƒƒYnXWdtj| ƒXqVytj||d�WqVtk �rÎ|tj|tjƒƒYqVXqVWdS)NF)Údir_fdr4r)r|z%Cannot call rmtree on a symbolic link)r,rjr.Úfilenamertrur-r`r8r:rvr>ÚO_RDONLYÚsamestatÚfstatÚ_rmtree_safe_fdryr;Úcloserx) Útopfdr-rzrJr^rLr{Úorig_str\Údirfdr r r!r�’sD$     r�c!Cs^|rdd„}n|dkrdd„}t�rPt|tƒr8tj|ƒ}ytj|ƒ}Wn&tk rl|tj|tjƒƒdSXytj |tj ƒ}Wn&tk r¦|tj|tjƒƒdSXz˜tj j |tj |ƒƒ�rt|||ƒytj|ƒWn(tk �r|tj|tjƒƒYnXn8y tdƒ‚Wn*tk �r<|tj j|tjƒƒYnXWdtj|ƒXn t||ƒ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. cWsdS)Nr )rOr r r!rzÏszrmtree..onerrorNcWs‚dS)Nr )rOr r r!rzÒsz%Cannot call rmtree on a symbolic link)Ú_use_fd_functionsÚ isinstanceÚbytesr,ÚfsdecoderCÚ Exceptionrtrur>r~r-rr€r�ryr.r;r‚rw)r-Ú ignore_errorsrzr„Úfdr r r!r Ãs<      cCs&tjjtjjpd}tjj|j|ƒƒS)NÚ)r,r-ÚsepÚaltsepraÚrstrip)r-rŽr r r!Ú _basenameúsr‘c Cs|}tjj|ƒrTt||ƒr*tj||ƒdStjj|t|ƒƒ}tjj|ƒrTtd|ƒ‚ytj||ƒWn–t k rútjj |ƒr¢tj |ƒ}tj ||ƒtj |ƒnTtjj|ƒrât||ƒrÈtd||fƒ‚t|||dd�t|ƒn|||ƒtj |ƒYnX|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. Nz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.T)rqro)r,r-r_r3Úrenamer`r‘rlr r.r;r=r<rxÚ _destinsrcr r )r1r2rqZreal_dstrsr r r!r s2              cCsVtjj|ƒ}tjj|ƒ}|jtjjƒs2|tjj7}|jtjjƒsL|tjj7}|j|ƒS)N)r,r-r0ÚendswithrŽÚ startswith)r1r2r r r!r“8s    r“c CsNtdks|dkrdSy t|ƒ}Wntk r8d}YnX|dk rJ|dSdS)z"Returns a gid, given a group name.Né)rÚKeyError)rLÚresultr r r!Ú_get_gidAs  r™c CsNtdks|dkrdSy t|ƒ}Wntk r8d}YnX|dk rJ|dSdS)z"Returns an uid, given a user name.Nr–)rr—)rLr˜r r r!Ú_get_uidMs  ršÚgzipc s"|dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntdj|ƒƒ‚d dl} |rfd |nd} |d | } tjj| ƒ} | r¶tjj | ƒ r¶|dk r¨|j d | ƒ|s¶tj | ƒ|dk rÈ|j d ƒt ˆƒ‰t ˆƒ‰‡‡‡‡fdd„} |�s| j| d|ƒ}z|j|| d�Wd|jƒX| 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›ZgzÚbzip2Úbz2ÚxzzCbad value for 'compress', or compression format not supported : {0}rÚ.z.tarz creating %szCreating tar archivecs,ˆdk rˆ|_ˆ|_ˆdk r(ˆ|_ˆ|_|S)N)ÚgidZgnameÚuidÚuname)Ztarinfo)r ÚgroupÚownerr¡r r!Ú _set_uid_gidˆsz#_make_tarball.._set_uid_gidzw|%s)rd)Ú_ZLIB_SUPPORTEDÚ_BZ2_SUPPORTEDÚ_LZMA_SUPPORTEDÚ ValueErrorr7Útarfiler,r-ÚdirnamerlÚinforkršr™r>Úaddr‚)Ú base_nameÚbase_dirÚcompressÚverboseÚdry_runr¤r£ÚloggerZtar_compressionrªZ compress_extZ archive_nameÚ archive_dirr¥Útarr )r r£r¤r¡r!Ú _make_tarballYs<          r¶c Cs|ddl}|d}tjj|ƒ}|rPtjj|ƒ rP|dk rB|jd|ƒ|sPtj|ƒ|dk rf|jd||ƒ|�sx|j|d|jd��ô}tjj |ƒ} | tj kr¶|j | | ƒ|dk r¶|jd| ƒx¶tj |ƒD]¨\} } } xFt | ƒD]:} tjj tjj| | ƒƒ} |j | | ƒ|dk rÖ|jd| ƒqÖWxT| D]L} tjj tjj| | ƒƒ} tjj| ƒ�r|j | | ƒ|dk �r|jd| ƒ�qWqÂWWdQRX|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. rNz.zipz creating %sz#creating '%s' and adding '%s' to itÚw)Z compressionz adding '%s')Úzipfiler,r-r«rlr¬rkÚZipFileZ ZIP_DEFLATEDÚnormpathÚcurdirr'ÚwalkÚsortedr`Úisfile)r®r¯r±r²r³r¸Z zip_filenamer´Zzfr-ÚdirpathZdirnamesÚ filenamesrLr r r!Ú _make_zipfilešs@             rÁrµr°zuncompressed tar filezgzip'ed tar-fileZgztarzZIP fileÚziprœzbzip2'ed tar-fileZbztarržzxz'ed tar-fileZxztarcCsdd„tjƒDƒ}|jƒ|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)r–r )Ú.0rLÚregistryr r r!ú Üsz'get_archive_formats..)Ú_ARCHIVE_FORMATSÚitemsÚsort)Úformatsr r r!r×s r�cCsz|dkr g}t|ƒs td|ƒ‚t|ttfƒs6tdƒ‚x0|D](}t|ttfƒ s\t|ƒdkr|dk r$|jd|ƒtjj|ƒ}|s>tj|ƒ|dkrLtj}||dœ} y t|} Wn tk r‚t d|ƒ‚YnX| d} x| dD]\} }|| | <q–W|dkrÂ|| d<|| d <z| ||f| Ž}Wd|dk rü|dk rò|jd | ƒtj| ƒX|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. Nzchanging into '%s')r²r³zunknown archive format '%s'rérÂr¤r£zchanging back to '%s') r,ÚgetcwdÚdebugr-r0Úchdirr»rÆr—r©)r®r7Zroot_dirr¯r±r²r¤r£r³Zsave_cwdrPÚ format_infoÚfuncÚargÚvalr}r r r!rùs6        cCsdd„tjƒDƒ}|jƒ|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ÃrLr¬r r r!rÅ6sz&get_unpack_formats..)Ú_UNPACK_FORMATSrÇrÈ)rÉr r r!r0s c Csvi}x.tjƒD]"\}}x|dD] }|||<q WqWx,|D]$}||kr:d}t||||fƒ‚q:Wt|ƒsrtdƒ‚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ÜrÇr$rÊrË) Ú extensionsrÏrÐZexisting_extensionsrLr¬ÚextÚ extensionÚmsgr r r!Ú_check_unpack_options;s rácCs,|dkr 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)rárÜ)rLrÝrÏrÐrÑr r r!rMs cCs t|=dS)z*Removes the pack format from the registry.N)rÜ)rLr r r!rcscCs&tjj|ƒ}tjj|ƒs"tj|ƒdS)z1Ensure that the parent directory of `path` existsN)r,r-r«r_rk)r-r«r r r!Ú_ensure_directorygs  râc CsÊddl}|j|ƒstd|ƒ‚|j|ƒ}z’xŒ|jƒD]€}|j}|jdƒs4d|krRq4tjj |f|j dƒžŽ}|spq4t |ƒ|j dƒs4|j |jƒ}t|dƒ}z|j|ƒWd|jƒ~Xq4WWd|jƒXdS)z+Unpack zip `filename` to `extract_dir` rNz%s is not a zip fileú/z..r6)r¸Z is_zipfiler#r¹Zinfolistr}r•r,r-r`Úsplitrâr”r&r>r'r‚) r}Ú extract_dirr¸rÂr¬rLÚtargetÚdataÚfr r r!Ú_unpack_zipfilems*       ré)rdcCs\ddl}y|j|ƒ}Wn"|jk r8td|ƒ‚YnXz|j||d�Wd|jƒXdS)zAUnpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir` rNz/%s is not a compressed or uncompressed tar file)rd)rªr>ZTarErrorr#Z extractallr‚)r}rårdrªZtarobjr r r!Ú_unpack_tarfile�srêz.tarz.zip)rµrÂz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:x4tjƒD](\}}x|dD]}|j|ƒr|SqWq WdS)Nr)rÜrÇr”)r}rLr¬rßr r r!Ú_find_unpack_format®s   rëc CsØ|dkrtjƒ}|dkri}nd|i}|dk r‚y t|}Wn"tk r\tdj|ƒƒ‚YnX|d}|||ft|dƒ|—ŽnRt|ƒ}|dkr tdj|ƒƒ‚t|d}tt|dƒ}|j |ƒ|||f|Ž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. NrdzUnknown unpack format '{0}'rÓr–zUnknown archive format '{0}') r,rÔrÜr—r©r7Údictrër#Úupdate)r}rår7rdZ filter_kwargsr×rØrPr r r!rµs&   ÚstatvfsÚ disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@tj|ƒ}|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,rîÚf_bavailÚf_frsizeÚf_blocksÚf_bfreeÚ_ntuple_diskusage)r-r@ÚfreeÚtotalÚusedr r r!rïìs    ÚntcCs"tj|ƒ\}}||}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. )røZ _getdiskusagerô)r-rörõr÷r r r!rïþscCsž|dkr|dkrtdƒ‚|}|}|dkr.d}n(t|tƒrVt|ƒ}|dkrVtdj|ƒƒ‚|dkrdd}n(t|tƒsŒt|ƒ}|dkrŒtdj|ƒƒ‚tj |||ƒ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. Nzuser and/or group must be setrÓzno such user: {!r}zno such group: {!r}éÿÿÿÿrù) r©r‡rnršÚ LookupErrorr7Úintr™r,r)r-Úuserr£Z_userZ_groupr r r!r s"  éPécCsÔyttjdƒ}Wnttfk r.d}YnXyttjdƒ}Wnttfk r^d}YnX|dksp|dkrÆytjtjjƒƒ}Wn$t tt fk r¨tj |ƒ}YnX|dkr¸|j }|dkrÆ|j }tj ||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. ZCOLUMNSrZLINES)rûr,Úenvironr—r©rrtÚ __stdout__ÚfilenoÚAttributeErrorr.Ú terminal_sizeÚcolumnsÚlines)ZfallbackrrÚsizer r r!r(s$  c s"dd„}tjjˆƒr&|ˆ|ƒr"ˆSdS|dkr>tjjdtjƒ}|sFdS|jtjƒ}tj dkr¼tj |krt|j dtj ƒtjjddƒjtjƒ}t ‡fd d „|Dƒƒr¨ˆg}q‡fd d „|Dƒ}nˆg}t ƒ}xT|D]L}tjj|ƒ}||krÎ|j|ƒx(|D] } tjj|| ƒ} || |ƒrö| SqöWqÎWdS) 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. cSs&tjj|ƒo$tj||ƒo$tjj|ƒ S)N)r,r-rlÚaccessr_)r?r\r r r!Ú _access_checkbszwhich.._access_checkNÚPATHZwin32rZPATHEXTr�c3s |]}ˆjƒj|jƒƒVqdS)N)Úlowerr”)rÃrÞ)Úcmdr r!ú szwhich..csg|] }ˆ|‘qSr r )rÃrÞ)r r r!rÅ‚szwhich..)r,r-r«rÿÚgetÚdefpathräÚpathseprtÚplatformr»ÚinsertÚanyrer/r­r`) r r\r-rZpathextÚfilesÚseenÚdirZnormdirZthefilerLr )r r!rUs8            é@)r)FN)r›rrNNN)rrN)r°N)r°r›)r°rœ)r°rž)Nr�)NNrrNNN)Nr�)NN)NN©rýrþ)r)Vr"r,rtr8rcÚ collectionsrFÚzlibr¦Ú ImportErrorr�r§Zlzmar¨ÚpwdrZgrprÚ__all__r.r rrrr#rŠr$rr3rrr+rNrrr rr rwr�r>rxryÚsupports_dir_fdrjÚ supports_fdrUr†r Zavoids_symlink_attacksr‘r r“r™ršr¶rÁrÆrrrrrrárrrârérêrÜrërrmÚ namedtuplerôrör÷rõrïrLrørrÚF_OKÚX_OKrr r r r!Úsþ          :  Y!,   5 8    @ -     6  "       /        -