Tryag File Manager
Home
-
Turbo Force
Current Path :
/
proc
/
self
/
root
/
usr
/
lib
/
python2.4
/
distutils
/
Upload File :
New :
File
Dir
//proc/self/root/usr/lib/python2.4/distutils/archive_util.pyc
mς =5Dc @ sψ d Z d Z d k Z d k l Z d k l Z d k l Z d k l Z d d d d Z d d d Z h d e d g d f <d e d g d f <d e d g d f <d e d g d f <d e g d f <Z d Z d d d d d Z d S( so distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).s8 $Id: archive_util.py 37828 2004-11-10 22:23:15Z loewis $N( s DistutilsExecError( s spawn( s mkpath( s logt gzipi c C s h d d <d d <d d <} h d d g <d d g <d d g <} | d j o | | i j o t d n | d } t t i i | d | d d | | g } t | d | | o2 t | g | | | g d | | | | Sn | Sd S( sή Create a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "compress", "bzip2", or None. Both "tar" and the compression utility named by 'compress' must be on the default program search path, so this is probably Unix-specific. The output tar file will be named 'base_dir' + ".tar", possibly plus the appropriate compression extension (".gz", ".bz2" or ".Z"). Return the output filename. R s .gzt bzip2s .bz2t compresss .Zs -f9s -fs= bad value for 'compress': must be None, 'gzip', or 'compress's .tart dry_runt tars -cfN( t compress_extt compress_flagsR t Nonet keyst ValueErrort base_namet archive_namet mkpatht ost patht dirnameR t base_dirt cmdt spawn( R R R t verboseR R R R R ( ( t, /usr/lib/python2.4/distutils/archive_util.pyt make_tarball s !* c C s y d k } Wn t j o d } n X| d } t t i i | d | | d j o^ | o d } n d } y t d | | | g d | Wqt j o t d | qXnc t i d | | d } | p? | i | d d | i } t i i | | | | i n | S( sq Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. Ns .zipR s -rs -rqt zipsk unable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilitys# creating '%s' and adding '%s' to itc C sn xg | D]_ } t i i t i i | | } t i i | o% | i | | t i d | q q Wd S( Ns adding '%s'( t namest nameR R t normpatht joinR t isfilet zt writet logt info( R R R R R ( ( R t visitb s !t wt compression( t zipfilet ImportErrorR R t zip_filenameR R R R R R t zipoptionsR R t DistutilsExecErrorR R R t ZipFilet ZIP_DEFLATEDR t walkt close( R R R R R R# R&