ACC SHELL

Path : /usr/lib/python/distutils/
File Upload :
Current File : //usr/lib/python/distutils/archive_util.pyo

Ńň
tÄMc
@sýdZdZddkZddklZddklZddklZddk	l
Z
dd	d	d
„Zd	d	d„Zhedgd
fd6edgdfd6edgdfd6edgdfd6egdfd6Zd„Zddd	d	d„ZdS(sodistutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing).sC$Id: archive_util.py 62904 2008-05-08 22:09:54Z benjamin.peterson $i˙˙˙˙N(tDistutilsExecError(tspawn(tmkpath(tlogtgzipic	Csňhdd6dd6dd6}hdgd6dgd6dgd6}|dj	o ||iƒjo
td	‚n|d
}ttii|ƒd|ƒdd
||g}t|d|ƒ|o/t|g|||gd|ƒ|||S|SdS(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.
    s.gzRs.bz2tbzip2s.Ztcompresss-f9s-fs=bad value for 'compress': must be None, 'gzip', or 'compress's.tartdry_runttars-cfN(tNonetkeyst
ValueErrorRtostpathtdirnameR(	t	base_nametbase_dirRtverboseRtcompress_exttcompress_flagstarchive_nametcmd((s,/usr/lib/python2.6/distutils/archive_util.pytmake_tarballs$




 


c
Cs‘yddk}Wntj
o
d}nX|d}ttii|ƒd|ƒ|djo^|o
d}nd}y td|||gd|ƒWqtj
otd|‚qXnŃt	i
d	||ƒ|pś|i|d
d|iƒ}xŠti
|ƒD]y\}}	}
xg|
D]_}tiitii||ƒƒ}tii|ƒo%|i||ƒt	i
d|ƒqqWqW|iƒn|S(
sqCreate 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.
    i˙˙˙˙Ns.zipRs-rs-rqtzipskunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilitys#creating '%s' and adding '%s' to ittwtcompressionsadding '%s'(tzipfiletImportErrorR	RRR
RRRRtinfotZipFiletZIP_DEFLATEDtwalktnormpathtjointisfiletwritetclose(
RRRRRtzip_filenamet
zipoptionstztdirpathtdirnamest	filenamestnameR
((s,/usr/lib/python2.6/distutils/archive_util.pytmake_zipfile<s@


	
!Rsgzip'ed tar-filetgztarRsbzip2'ed tar-filetbztarscompressed tar filetztarsuncompressed tar fileRsZIP fileRcCs+x$|D]}|tjo|SqWdSdS(N(tARCHIVE_FORMATSR	(tformatstformat((s,/usr/lib/python2.6/distutils/archive_util.pytcheck_archive_formats{s

	c
	Cs(tiƒ}|dj	o>tid|ƒtii|ƒ}|pti|ƒqWn|djo
ti}nh|d6}yt	|}Wn t
j
otd|‚nX|d}	x"|dD]\}
}|||
<qÄWt|	||f|ƒ}|dj	o!tid|ƒti|ƒn|S(stCreate 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", "ztar", or "gztar".
    '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.
    schanging into '%s'Rsunknown archive format '%s'iischanging back to '%s'N(
RtgetcwdR	RtdebugR
tabspathtchdirtcurdirR0tKeyErrorRtapply(
RR2troot_dirRRRtsave_cwdtkwargstformat_infotfunctargtvaltfilename((s,/usr/lib/python2.6/distutils/archive_util.pytmake_archive‚s,






(scompresssgzip(scompresssbzip2(scompressscompress(scompressN(t__doc__t__revision__Rtdistutils.errorsRtdistutils.spawnRtdistutils.dir_utilRt	distutilsRRR,R	R0R3RC(((s,/usr/lib/python2.6/distutils/archive_util.pyt<module>s$+7	

ACC SHELL 2018