config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/tarfile.pyc

hRc@s2dZdZdZdZdZdZdZddkZddkZddk	Z	ddk
Z
ddkZddkZddk
Z
ddkZeid	jo
ed
nyddkZddkZWnej
oeZZnXddd
dgZdZdZedZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'd Z(d!Z)eee e!e$e%e&e"e#e'e(e)fZ*eee&e)fZ+d"Z,d#Z-d$Z.d%Z/d&Z0d'Z1d(Z2d)Z3dZ4d*Z5d+Z6d,Z7d-Z8d.Z9d/Z:d0Z;d1Z<d2Z=d3Z>d4Z?d5Z@d/eAd6ZBd7ZCed8ZDe,d9fe-d:fe.d;fe/d<fe0d=fe1d>ffe5d?ffe6d@ffe7e2BdAfe2d!fe7dBffe8d?ffe9d@ffe:e3BdAfe3d!fe:dBffe;d?ffe<d@ffe=e4BdCfe4dDfe=dBfff
ZEdEZFeiGdFjo
dGZHn
eiIiHZHdeJfdHYZKdIeKfdJYZLdKeKfdLYZMdMeKfdNYZNdOeKfdPYZOdQfdRYZPdSfdTYZQdUeRfdVYZSdWeRfdXYZTdYeRfdZYZUd[eRfd\YZVdeRfd]YZWdeRfd^YZXd_fd`YZYdafdbYZZdceZfddYZ[deeZfdfYZ\dge]fdhYZ^diZ_d/Z`djfdkYZadlZbeXicZcdS(ms,Read from and write to tar format archives.
s$Revision: 60730 $s0.8.0s!Lars Gustbel (lars@gustaebel.de)s5$Date: 2008-02-11 19:36:07 +0100 (Mon, 11 Feb 2008) $s;$Id: tarfile.py 60730 2008-02-11 18:36:07Z lars.gustaebel $s3Gustavo Niemeyer, Niels Gustbel, Richard Townsend.iNtmacs'tarfile does not work for platform==mactTarFiletTarInfot
is_tarfiletTarErrortiitustart00idilt0t1t2t3t4t5t6t7tLtKtSiii`i@i iiiiii@i iiiiicCs|| |t|tS(s@Convert a python string to a null-terminated string buffer.
    (tlentNUL(tstlength((s#/usr/local/lib/python2.5/tarfile.pytstnscCs,|id}|djo|Sn|| S(s?Convert a null-terminated string field to a python string.
    Ri(tfind(Rtp((s#/usr/local/lib/python2.5/tarfile.pytntss
cCs|dtdjo tt|pdd}nJd}x@tt|dD](}|dK}|t||d7}qTW|S(s/Convert a number field to a python number.
    iiRili(tchrtintRtxrangeRtord(Rtnti((s#/usr/local/lib/python2.5/tarfile.pytntis 
cCsd|jod|djnod|d|ft}n|otdn|djo&tidtid|d}nd}x6t|dD]$}t|d	@|}|dL}qWtd
|}|S(s/Convert a python number to a number field.
    iiis%0*osoverflow in number fieldRtltii(Rt
ValueErrortstructtunpacktpackRR(RtdigitstposixRR ((s#/usr/local/lib/python2.5/tarfile.pytitns	&
&cCsxdttid|d tid|dd!}dttid|d tid|dd!}||fS(	sCalculate the checksum for a member's header by summing up all
       characters except for the chksum field which is treated as if
       it was filled with spaces. According to the GNU tar sources,
       some tars (Sun and NeXT) calculate chksum with signed char,
       which will be different if there are chars in the buffer with
       the high bit set. So we calculate two checksums, unsigned and
       signed.
    it148Bit356Biit148bt356b(tsumR%R&(tbuftunsigned_chksumt
signed_chksum((s#/usr/local/lib/python2.5/tarfile.pytcalc_chksumss	77cCs|djodSn|djoti||dSnd}t||\}}xSt|D]E}|i|}t||jotdn|i|qbW|djoC|i|}t||jotdn|i|ndS(sjCopy length bytes from fileobj src to fileobj dst.
       If length is None, copy the entire content.
    iNiisend of file reachedi@(	tNonetshutiltcopyfileobjtdivmodRtreadRtIOErrortwrite(tsrctdstRtBUFSIZEtblockst	remaindertbR0((s#/usr/local/lib/python2.5/tarfile.pyR6s&



R"t-R@tdtcRtrtwRtxtttTcCskg}xUtD]M}xD|D]/\}}||@|jo|i|PqqW|idq
Wdi|S(scConvert a file's mode to a string of the form
       -rwxrwxrwx.
       Used by TarFile.list()
    RAR#(tfilemode_tabletappendtjoin(tmodetpermttabletbittchar((s#/usr/local/lib/python2.5/tarfile.pytfilemodes
	t/cCstii|itidS(RR(tostpathtnormpathtreplacetsep(RT((s#/usr/local/lib/python2.5/tarfile.pyt<lambda>scBseZdZRS(sBase exception.(t__name__t
__module__t__doc__(((s#/usr/local/lib/python2.5/tarfile.pyRstExtractErrorcBseZdZRS(s%General exception for extract errors.(RYRZR[(((s#/usr/local/lib/python2.5/tarfile.pyR\st	ReadErrorcBseZdZRS(s%Exception for unreadble tar archives.(RYRZR[(((s#/usr/local/lib/python2.5/tarfile.pyR]stCompressionErrorcBseZdZRS(s.Exception for unavailable compression methods.(RYRZR[(((s#/usr/local/lib/python2.5/tarfile.pyR^stStreamErrorcBseZdZRS(s=Exception for unsupported operations on stream-like TarFiles.(RYRZR[(((s#/usr/local/lib/python2.5/tarfile.pyR_!st
_LowLevelFilecBs2eZdZdZdZdZdZRS(sLow-level file object. Supports reading and writing.
       It is used instead of a regular file object for streaming
       access.
    cCsjhtid<titiBtiBd<|}ttdo|tiO}nti|||_dS(NRDREtO_BINARY(	RStO_RDONLYtO_WRONLYtO_CREATtO_TRUNCthasattrRatopentfd(tselftnameRL((s#/usr/local/lib/python2.5/tarfile.pyt__init__.scCsti|idS(N(RStcloseRh(Ri((s#/usr/local/lib/python2.5/tarfile.pyRl7scCsti|i|S(N(RSR8Rh(Ritsize((s#/usr/local/lib/python2.5/tarfile.pyR8:scCsti|i|dS(N(RSR:Rh(RiR((s#/usr/local/lib/python2.5/tarfile.pyR:=s(RYRZR[RkRlR8R:(((s#/usr/local/lib/python2.5/tarfile.pyR`(s
				t_StreamcBseZdZdZdZdZdZdZdZdZ	dZ
d	d
ZddZ
dZd
ZRS(sClass that serves as an adapter between TarFile and
       a stream-like object.  The stream-like object only
       needs to have a read() or write() method and is accessed
       blockwise.  Use of gzip or bzip2 compression is possible.
       A stream-like object could be for example: sys.stdin,
       sys.stdout, a socket, a tape device etc.

       _Stream is intended to be used only internally.
    c
Cst|_|djot||}t|_n|djot|}|i}n|pd|_||_||_	||_
||_d|_d|_
t|_|djovyddk}Wntj
otdnX||_|id|_|djo|iq-|in|d	jonyddk}Wntj
otd
nX|djod|_|i|_q|i|_ndS(s$Construct a _Stream object.
        t*R#ltgziNszlib module is not availableRDtbz2sbz2 module is not available(tTruet_extfileobjR4R`tFalset_StreamProxytgetcomptypeRjRLtcomptypetfileobjtbufsizeR0tpostclosedtzlibtImportErrorR^tcrc32tcrct
_init_read_gzt_init_write_gzRqtdbuftBZ2Decompressortcmpt
BZ2Compressor(RiRjRLRwRxRyR|Rq((s#/usr/local/lib/python2.5/tarfile.pyRkKsD	


							
	


	cCs-t|do|io|indS(NR{(RfR{Rl(Ri((s#/usr/local/lib/python2.5/tarfile.pyt__del__yscCs|iid|ii|ii|iid|_tidtt	i	}|i
d||iido|id |_n|i
|it
dS(s6Initialize for writing with gzip compression.
        i	is<Ls%ss.gziN(R|tcompressobjtDEFLATEDt	MAX_WBITSt
DEF_MEM_LEVELRR%R'tlongttimet_Stream__writeRjtendswithR(Rit	timestamp((s#/usr/local/lib/python2.5/tarfile.pyR}s
	cCs{|idjo|ii||i|_n|it|7_|idjo|ii|}n|i|dS(s&Write string s to the stream.
        RpttarN(	RwR|R~RRzRRtcompressR(RiR((s#/usr/local/lib/python2.5/tarfile.pyR:scCsa|i|7_xKt|i|ijo1|ii|i|i |i|i|_qWdS(s]Write string s to the stream if a whole new block
           is ready to be written.
        N(R0RRyRxR:(RiR((s#/usr/local/lib/python2.5/tarfile.pyt__writes
cCs
|iodSn|idjo,|idjo|i|ii7_n|idjo|ioz|ii|id|_|idjoJ|iiti	d|i
d@|iiti	d|id@qn|ip|ii
nt|_dS(s[Close the _Stream object. No operation should be
           done on it afterwards.
        NRERR#Rps<Ll(R{RLRwR0RtflushRxR:R%R'RRzRsRlRr(Ri((s#/usr/local/lib/python2.5/tarfile.pyRls
 	#+
cCs|ii|ii|_d|_|iddjotdn|iddjotdnt|id}|id|d	@o=t|idd
t|id}|i	|n|d@o<x9t
o-|id}|p
|tjoPqqWn|d@o<x9t
o-|id}|p
|tjoPq0q0Wn|d@o|idnd
S(s:Initialize for reading a gzip compressed fileobj.
        R#issnot a gzip fileissunsupported compression methodiiiiiN(R|t
decompressobjRRRt
_Stream__readR]R^RR8RrR(RitflagtxlenR((s#/usr/local/lib/python2.5/tarfile.pyRs2	
,cCs|iS(s3Return the stream's file pointer position.
        (Rz(Ri((s#/usr/local/lib/python2.5/tarfile.pyttellsicCs~||idjoWt||i|i\}}x$t|D]}|i|iq@W|i|n
td|iS(sXSet the stream's file pointer to pos. Negative seeking
           is forbidden.
        is seeking backwards is not allowed(RzR7RyRR8R_(RiRzR>R?R ((s#/usr/local/lib/python2.5/tarfile.pytseeks
cCs|djoSg}x7to/|i|i}|pPn|i|qWdi|}n|i|}|it|7_|S(sReturn the next size number of bytes from the stream.
           If size is not defined, return all bytes of the stream
           up to EOF.
        R#N(R4Rrt_readRyRJRKRzR(RiRmRGR0((s#/usr/local/lib/python2.5/tarfile.pyR8s
cCs|idjo|i|Snt|i}|ig}x_||joQ|i|i}|pPn|ii|}|i||t|7}q?Wdi|}|||_|| S(s+Return size bytes from the stream.
        RR#(	RwRRRRyRt
decompressRJRK(RiRmRCRGR0((s#/usr/local/lib/python2.5/tarfile.pyRs


cCst|i}|ig}xP||joB|ii|i}|pPn|i||t|7}qWdi|}|||_|| S(ssReturn size bytes from stream. If internal buffer is empty,
           read another block from the stream.
        R#(RR0RxR8RyRJRK(RiRmRCRGR0((s#/usr/local/lib/python2.5/tarfile.pyt__reads


N(RYRZR[RkRRR:RRlRRRR4R8RR(((s#/usr/local/lib/python2.5/tarfile.pyRn@s		.		
	
					
	RucBs2eZdZdZdZdZdZRS(ssSmall proxy class that enables transparent compression
       detection for the Stream interface (mode 'r|*').
    cCs"||_|iit|_dS(N(RxR8t	BLOCKSIZER0(RiRx((s#/usr/local/lib/python2.5/tarfile.pyRk%s	cCs|ii|_|iS(N(RxR8R0(RiRm((s#/usr/local/lib/python2.5/tarfile.pyR8)scCs:|iidodSn|iidodSndS(NsRptBZh91RqR(R0t
startswith(Ri((s#/usr/local/lib/python2.5/tarfile.pyRv-s
cCs|iidS(N(RxRl(Ri((s#/usr/local/lib/python2.5/tarfile.pyRl4s(RYRZR[RkR8RvRl(((s#/usr/local/lib/python2.5/tarfile.pyRu s
			t	_BZ2ProxycBsSeZdZd
ZdZdZdZdZdZdZ	d	Z
RS(sSmall proxy class that enables external file object
       support for "r:bz2" and "w:bz2" modes. This is actually
       a workaround for a limitation in bz2 module's BZ2File
       class which (unlike gzip.GzipFile) has no support for
       a file object argument.
    iicCs ||_||_|idS(N(RxRLtinit(RiRxRL((s#/usr/local/lib/python2.5/tarfile.pyRkBs		cCsdddk}d|_|idjo,|i|_|iidd|_n|i|_dS(NiiRDR#(	RqRzRLRtbz2objRxRR0R(RiRq((s#/usr/local/lib/python2.5/tarfile.pyRGs	
cCs|ig}t|i}xq||jocy8|ii|i}|ii|}|i|Wntj
oPnX|t|7}qWdi	||_|i| }|i||_|i
t|7_
|S(NR#(R0RRxR8t	blocksizeRRRJtEOFErrorRKRz(RiRmR@RFtrawtdataR0((s#/usr/local/lib/python2.5/tarfile.pyR8Qs 

cCs6||ijo|in|i||idS(N(RzRR8(RiRz((s#/usr/local/lib/python2.5/tarfile.pyRcscCs|iS(N(Rz(Ri((s#/usr/local/lib/python2.5/tarfile.pyRhscCs;|it|7_|ii|}|ii|dS(N(RzRRRRxR:(RiRR((s#/usr/local/lib/python2.5/tarfile.pyR:kscCsD|idjo#|ii}|ii|n|iidS(NRE(RLRRRxR:Rl(RiR((s#/usr/local/lib/python2.5/tarfile.pyRlpsi@(RYRZR[RRkRR8RRR:Rl(((s#/usr/local/lib/python2.5/tarfile.pyR8s		
				t_FileInFilecBsSeZdZddZdZdZddZdZdZ	dZ
RS(	sA thin wrapper around an existing file object that
       provides a part of its data as an individual file
       object.
    cCs1||_||_||_||_d|_dS(Ni(RxtoffsetRmtsparsetposition(RiRxRRmR((s#/usr/local/lib/python2.5/tarfile.pyRks
				cCs|iS(s*Return the current file position.
        (R(Ri((s#/usr/local/lib/python2.5/tarfile.pyRscCs
||_dS(s(Seek to a position in the file.
        N(R(RiR((s#/usr/local/lib/python2.5/tarfile.pyRscCsl|djo|i|i}nt||i|i}|idjo|i|Sn|i|SdS(s!Read data from the file.
        N(R4RmRtminRt
readnormalt
readsparse(RiRm((s#/usr/local/lib/python2.5/tarfile.pyR8s
cCs9|ii|i|i|i|7_|ii|S(s*Read operation for regular files.
        (RxRRRR8(RiRm((s#/usr/local/lib/python2.5/tarfile.pyRscCs`g}xJ|djo<|i|}|pPn|t|8}|i|q	Wdi|S(s)Read operation for sparse files.
        iR#(treadsparsesectionRRJRK(RiRmRR0((s#/usr/local/lib/python2.5/tarfile.pyRs
cCs|ii|i}|djodSnt||i|i|i}t|toQ|i	|i|i}|i
i|i||i|7_|i
i|Sn|i|7_t
|SdS(s0Read a single section of a sparse file.
        R#N(RRRR4RRRmt
isinstancet_datatrealposRxRR8R(RiRmtsectionR((s#/usr/local/lib/python2.5/tarfile.pyRs
 N(RYRZR[R4RkRRR8RRR(((s#/usr/local/lib/python2.5/tarfile.pyRzs		
		tExFileObjectcBsheZdZdZdZddZddZdZdZ	e
idZd	Z
d
ZRS(saFile-like object for reading an archive member.
       Is returned by TarFile.extractfile().
    icCsmt|i|i|it|dd|_|i|_d|_t|_	|i|_d|_
d|_dS(NRRDiR#(RRxtoffset_dataRmtgetattrR4RjRLRtR{Rtbuffer(Rittarfilettarinfo((s#/usr/local/lib/python2.5/tarfile.pyRks				cCs|iotdnd}|ioD|djo|i}d|_qn|i| }|i||_n|djo||ii7}n!||ii|t|7}|it|7_|S(s~Read at most size bytes from the file. If size is not
           present or None, read all data until EOF is reached.
        sI/O operation on closed fileR#N(R{R$RR4RxR8RR(RiRmR0((s#/usr/local/lib/python2.5/tarfile.pyR8s


	


 icCs9|iotdnd|ijo|iidd}n|ig}xto|ii|i}|i||p
d|joMdi	||_|iidd}|djot
|i}nPqSqSW|djot||}n|i| }|i||_|it
|7_|S(sRead one entire line from the file. If size is present
           and non-negative, return a string with at most that
           size, which may be an incomplete line.
        sI/O operation on closed files
iR#ii(
R{R$RRRrRxR8RRJRKRRR(RiRmRztbuffersR0((s#/usr/local/lib/python2.5/tarfile.pytreadlines*





cCs>g}x1to)|i}|pPn|i|q	W|S(s0Return a list with all remaining lines.
        (RrRRJ(Ritresulttline((s#/usr/local/lib/python2.5/tarfile.pyt	readlinesscCs!|iotdn|iS(s*Return the current file position.
        sI/O operation on closed file(R{R$R(Ri((s#/usr/local/lib/python2.5/tarfile.pyRs
cCs|iotdn|tijo"tt|d|i|_n|tijoJ|djot|i|d|_qt|i||i|_nF|ti	jo)tt|i||id|_n
tdd|_
|ii|idS(s(Seek to a position in the file.
        sI/O operation on closed fileisInvalid argumentR#N(
R{R$RStSEEK_SETRtmaxRmRtSEEK_CURtSEEK_ENDRRxR(RiRztwhence((s#/usr/local/lib/python2.5/tarfile.pyR"s
"
 )	cCs
t|_dS(sClose the file object.
        N(RrR{(Ri((s#/usr/local/lib/python2.5/tarfile.pyRl7sccs0x)to!|i}|pPn|VqWdS(s/Get an iterator over the file's lines.
        N(RrR(RiR((s#/usr/local/lib/python2.5/tarfile.pyt__iter__<sN(RYRZR[RRkR4R8RRRRSRRRlR(((s#/usr/local/lib/python2.5/tarfile.pyRs	
	
		cBseZdZddZdZedZedZdZ	dZ
dZd	Zd
Z
dZdZd
ZdZdZdZRS(sInformational class which holds the details about an
       archive member given by a tar header block.
       TarInfo objects are returned by TarFile.getmember(),
       TarFile.getmembers() and TarFile.gettarinfo() and are
       usually created internally.
    R#cCs||_d|_d|_d|_d|_d|_d|_t|_d|_	d|_
d|_d|_d|_
d|_d|_dS(sXConstruct a TarInfo object. name is the optional name
           of the member.
        iiR#tusertgroupN(RjRLtuidtgidRmtmtimetchksumtREGTYPEttypetlinknametunametgnametdevmajortdevminorRR(RiRj((s#/usr/local/lib/python2.5/tarfile.pyRkQs														cCs d|ii|it|fS(Ns<%s %r at %#x>(t	__class__RYRjtid(Ri((s#/usr/local/lib/python2.5/tarfile.pyt__repr__fscCst|tjotdn|ittjotdn|}||_t|dd!|_t|dd!|_	t|dd!|_
t|dd!|_t|dd!|_t|dd	!|_
t|d	d
!|_|d
d!|_t|dd!|_t|d
d!|_t|dd!|_t|dd!|_t|dd!|_t|dd!}|o&|io|d|i|_n|it|jotdn|S(sBConstruct a TarInfo object from a 512 byte string buffer.
        struncated headersempty headeriidiliti|iiiiii	i)iIiQiYiRRsinvalid header(RRR$tcountRR0RRjR!RLRRRmRRRRRRRRtissparseR3(tclsR0Rtprefix((s#/usr/local/lib/python2.5/tarfile.pytfrombufis2		c	Cs+d}|i}d}|iido
t}n|ttfjo
|i}nt|i}|tjo|d7}n|i}|ot|}n|o|it	jot
dnt|itjot
dtnt|t
jo|td }x'|o|ddjo|d }qW|t|}|d }|pt|t
jot
dqqnat|itjo||i|it7}nt|t
jo||i|t7}nt|dt|id	@d
|t|id
|t|id
|t|id|t|id|d|t|idttd
ttdt|idt|idt|id
|t|id
|t|dg}|di|itt7}t |td}|d d||d}||_!|S(s<Return a tar header as a string of 512 byte blocks.
        R#RRsfile is too large (>= 8 GB)slinkname is too long (>%d)iisname is too longidiiis        iii iiis%06oi("RRjRtDIRTYPEtGNUTYPE_LONGNAMEtGNUTYPE_LONGLINKRURRmtMAXSIZE_MEMBERR$RtLENGTH_LINKtLENGTH_NAMEt
LENGTH_PREFIXt_create_gnulongRR*RLRRRtMAGICtVERSIONRRRRRKtljustRRR3R0(	RiR)R0RRRjRtpartsR((s#/usr/local/lib/python2.5/tarfile.pyttobufsh	


	
	cCs|t7}|i}d|_||_d|_t||_|i}||7}tt|t	\}}|djo|t	|t7}n|S(sCreate a GNU longname/longlink header from name.
           It consists of an extended tar header, with the length
           of the longname as size, followed by data blocks,
           which contain the longname as a null terminated string.
        s
././@LongLinki(
RRRjRRLRRmRR7R(RiRjRRR0R>R?((s#/usr/local/lib/python2.5/tarfile.pyRs
			

cCs
|itjS(N(Rt
REGULAR_TYPES(Ri((s#/usr/local/lib/python2.5/tarfile.pytisregscCs
|iS(N(R(Ri((s#/usr/local/lib/python2.5/tarfile.pytisfilescCs
|itjS(N(RR(Ri((s#/usr/local/lib/python2.5/tarfile.pytisdirscCs
|itjS(N(RtSYMTYPE(Ri((s#/usr/local/lib/python2.5/tarfile.pytissymscCs
|itjS(N(RtLNKTYPE(Ri((s#/usr/local/lib/python2.5/tarfile.pytislnkscCs
|itjS(N(RtCHRTYPE(Ri((s#/usr/local/lib/python2.5/tarfile.pytischrscCs
|itjS(N(RtBLKTYPE(Ri((s#/usr/local/lib/python2.5/tarfile.pytisblkscCs
|itjS(N(RtFIFOTYPE(Ri((s#/usr/local/lib/python2.5/tarfile.pytisfifoscCs
|itjS(N(RtGNUTYPE_SPARSE(Ri((s#/usr/local/lib/python2.5/tarfile.pyRscCs|itttfjS(N(RRRR(Ri((s#/usr/local/lib/python2.5/tarfile.pytisdevs(RYRZR[RkRtclassmethodRRtRRRRRRRRRRRR(((s#/usr/local/lib/python2.5/tarfile.pyRIs 	!K										cBs	eZdZdZeZeZdZeZe	Z
d3dd3dZe
d3dd3d4dZe
dd3dZe
dd3dd	Ze
dd3dd
Zhdd<d
d<dd<ZdZdZdZdZd3d3d3dZedZd3edZd3dZdd3dZddZdZdZdZ d Z!d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'd'Z(d(Z)d)Z*d*Z+d+Z,d,Z-d-Z.d3d.Z/d/Z0d3d0Z1d1Z2d2Z3RS(5s=The TarFile Class provides an interface to tar archives.
    iRDcCst|djp
|djotdn||_hdd<dd<dd	<||_|pt||i}t|_nT|djot|d
o
|i	}nt|do|i|_nt
|_|otii
|nd|_	||_t|_g|_t|_|ii|_h|_|idjod|_|i|_n|idjoyd|_xmt
oay|i}Wn$tj
o|iidPnX|djo|iitdPqqWn|id
jo
t
|_ndS(sOpen an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        iRsmode must be 'r', 'a' or 'w'trbRDsr+btatwbRERjRLitawN(RR$t_modeRLtfileRtRsR4RfRjRrRSRTtabspathRxR{tmemberst_loadedRRtinodestfirstmembertnextR]RR(RiRjRLRxR((s#/usr/local/lib/python2.5/tarfile.pyRksH	 	(

	#							
iic
	Cs'|o|otdn|djox|iD]}t||i|}|dj	o|i}ny||d|SWq7ttfj
o(|dj	o|i|q7q7q7Xq7WtdnCd|jo|idd\}}|pd}|pd}||ijot||i|}ntd|||||Snd	|jo|id	d\}}|pd}|pd}|d
jotdn|||t	|||||}	t
|	_|	Sn%|djo|i|||Sntd
dS(s\Open a tar archive for reading, writing or appending. Return
           an appropriate TarFile class.

           mode:
           'r' or 'r:*' open for reading with transparent compression
           'r:'         open for reading exclusively uncompressed
           'r:gz'       open for reading with gzip compression
           'r:bz2'      open for reading with bzip2 compression
           'a' or 'a:'  open for appending
           'w' or 'w:'  open for writing without compression
           'w:gz'       open for writing with gzip compression
           'w:bz2'      open for writing with bzip2 compression

           'r|*'        open a stream of tar blocks with transparent compression
           'r|'         open an uncompressed stream of tar blocks for reading
           'r|gz'       open a gzip compressed stream of tar blocks
           'r|bz2'      open a bzip2 compressed stream of tar blocks
           'w|'         open an uncompressed stream for writing
           'w|gz'       open a gzip compressed stream for writing
           'w|bz2'      open a bzip2 compressed stream for writing
        snothing to openRDsr:*s%file could not be opened successfullyt:iRsunknown compression type %rt|trwsmode must be 'r' or 'w'Rsundiscernible modeN(RDsr:*(
R$t	OPEN_METHRR4RR]R^RtsplitRnRtRsttaropen(
RRjRLRxRyRwtfunct	saved_posRQRG((s#/usr/local/lib/python2.5/tarfile.pyRgZsH










		
cCs@t|djp
|djotdn||||S(sCOpen uncompressed tar archive name for reading or writing.
        iRsmode must be 'r', 'a' or 'w'(RR$(RRjRLRx((s#/usr/local/lib/python2.5/tarfile.pyRs i	cCst|djp
|djotdnyddk}|iWn%ttfj
otdnX|djot||d}ny+|i	|||i||||}Wnt
j
otdnXt|_
|S(	skOpen gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        iRsmode must be 'r' or 'w'iNsgzip module is not availableR@snot a gzip file(RR$tgziptGzipFileR}tAttributeErrorR^R4RRR9R]RtRs(RRjRLRxt
compresslevelRRG((s#/usr/local/lib/python2.5/tarfile.pytgzopens  
	cCst|djp
|djotdnyddk}Wntj
otdnX|dj	ot||}n|i||d|}y|i|||}Wnt	j
ot
dnXt|_|S(	slOpen bzip2 compressed tar archive name for reading or writing.
           Appending is not allowed.
        iRsmode must be 'r' or 'w'.iNsbz2 module is not availableRsnot a bzip2 file(
RR$RqR}R^R4RtBZ2FileRR9R]RtRs(RRjRLRxRRqRG((s#/usr/local/lib/python2.5/tarfile.pytbz2opens 
	RRRRpRRqcCs|iodSn|idjop|iittd|itd7_t|it\}}|djo|iitt|qn|i	p|ii
nt|_dS(slClose the TarFile. In write-mode, two finishing zero blocks are
           appended to the archive.
        NRii(R{RRxR:RRRR7t
RECORDSIZERsRlRr(RiR>R?((s#/usr/local/lib/python2.5/tarfile.pyRls

 
cCs4|i|}|djotd|n|S(sReturn a TarInfo object for member `name'. If `name' can not be
           found in the archive, KeyError is raised. If a member occurs more
           than once in the archive, its last occurence is assumed to be the
           most up-to-date version.
        sfilename %r not foundN(t
_getmemberR4tKeyError(RiRjR((s#/usr/local/lib/python2.5/tarfile.pyt	getmembers
cCs)|i|ip|in|iS(sReturn the members of the archive as a list of TarInfo objects. The
           list has the same order as the members in the archive.
        (t_checkRt_loadR(Ri((s#/usr/local/lib/python2.5/tarfile.pyt
getmemberss

cCs(g}|iD]}||iq~S(sReturn the members of the archive as a list of their names. It has
           the same order as the list returned by getmembers().
        (RRj(Rit_[1]R((s#/usr/local/lib/python2.5/tarfile.pytgetnamesscCs|id|dj	o
|i}n|djo
|}nt|}tii|\}}x#|dd!djo|d}qeWt}|djoAttdo|i	oti
|}qti|}nti|i
}d}|i}ti|oz|i|if}	|i	o7|idjo'|	|ijot}
|i|	}qAt}
|	do||i|	<qAnti|o)t}
|ddjo|d7}qAn|ti|o
t}
nbti|ot}
ti|}n9ti|o
t}
nti|o
t }
ndS||_||_!|i"|_#|i$|_%ti|o|i&|_'n
d|_'|i(|_)|
|_*||_+t,o7yt,i-|i#d|_.Wqt/j
oqXnt0o7yt0i1|i%d|_2Wq.t/j
oq.Xn|
tt fjoRttd	o>ttd
o.ti3|i4|_5ti6|i4|_7qn|S(sOCreate a TarInfo object for either the file `name' or the file
           object `fileobj' (using os.fstat on its file descriptor). You can
           modify some of the TarInfo's attributes before you add it using
           addfile(). If given, `arcname' specifies an alternative name for the
           file in the archive.
        RiiRRtlstatR#iltmajortminorN(8RR4RjRURSRTt
splitdriveRRftdereferenceRtstattfstattfilenotst_modetS_ISREGtst_inotst_devtst_nlinkRRRtS_ISDIRRtS_ISFIFORtS_ISLNKRtreadlinktS_ISCHRRtS_ISBLKRRLtst_uidRtst_gidRtst_sizeRmtst_mtimeRRRtpwdtgetpwuidRRtgrptgetgrgidRRtst_rdevRRR(RiRjtarcnameRxtdrvRtstatresRtstmdtinodeR((s#/usr/local/lib/python2.5/tarfile.pyt
gettarinfos




	
	 


							 cCs|ix|D]}|ot|iGd|ip|i|ip|ifG|ip
|iodd|i	|i
fGnd|iGdti
|id Gn|iG|o<|iodG|iGn|iodG|iGqnHqWd	S(
sPrint a table of contents to sys.stdout. If `verbose' is False, only
           the names of the members are printed. If it is True, an `ls -l'-like
           output is produced.
        s%s/%ss%10ss%d,%ds%10ds%d-%02d-%02d %02d:%02d:%02dis->slink toN(RRQRLRRRRRRRRRmRt	localtimeRRjRRR(RitverboseR((s#/usr/local/lib/python2.5/tarfile.pytlistys(



cCs|id|djo
|}n|idj	o8tii||ijo|idd|dSn|djoc|oT|djo
d}nx:tidD]%}|i|tii	||qWndSn|id||i
||}|djo|idd|dSn|io-t|d	}|i
|||in|iod|i
||oLxIti|D]4}|itii	||tii	||qWqn|i
|dS(
sQAdd the file `name' to the archive. `name' may be any type of file
           (directory, fifo, symbolic link, etc.). If given, `arcname'
           specifies an alternative name for the file in the archive.
           Directories are added recursively by default. This can be avoided by
           setting `recursive' to False.
        Ristarfile: Skipped %rNt.R#istarfile: Unsupported type %rR(RR4RjRSRTRt_dbgtlistdirtaddRKR<RRtaddfileRlR(RiRjR7t	recursivetfR((s#/usr/local/lib/python2.5/tarfile.pyRCs<


,


'



:cCs|idti|}|i|i}|ii||it|7_|dj	oxt	||i|i
t|i
t\}}|djo&|iit
t||d7}n|i|t7_n|ii|dS(s]Add the TarInfo object `tarinfo' to the archive. If `fileobj' is
           given, tarinfo.size bytes are read from it and added to the archive.
           You can create TarInfo objects using gettarinfo().
           On Windows platforms, `fileobj' should always be opened with mode
           'rb' to avoid irritation about the file size.
        RiiN(RtcopyRR)RxR:RRR4R6RmR7RRRRJ(RiRRxR0R>R?((s#/usr/local/lib/python2.5/tarfile.pyRDs


R@c	Cs2g}|djo
|}nxT|D]L}|io)|i|ti|}d|_n|i||q$W|id|ix|D]}ti	i
||i}y4|i|||i
|||i||Wqtj
o4}|idjoq*|idd|qXqWdS(sMExtract all members from the archive to the current working
           directory and set owner, modification time and permissions on
           directories afterwards. `path' specifies a different directory
           to extract to. `members' is optional and must be a subset of the
           list returned by getmembers().
        icSst|i|iS((RRj(RR@((s#/usr/local/lib/python2.5/tarfile.pyRXsistarfile: %sN(R4RRJRGRLtextracttsorttreverseRSRTRKRjtchowntutimetchmodR\t
errorlevelRA(RiRTRtdirectoriesRtdirpathte((s#/usr/local/lib/python2.5/tarfile.pyt
extractalls.





R#cCsE|idt|to
|}n|i|}|iotii||i|_	ny&|i
|tii||iWntj
ok}|i
djoqA|idjo|idd|iqA|idd|i|ifnAtj
o4}|i
djoqA|idd|nXdS(s#Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a TarInfo object. You can
           specify a different directory using `path'.
        RDiistarfile: %sstarfile: %s %rN(RRRRRRSRTRKRt_link_targett_extract_memberRjtEnvironmentErrorRNtfilenameR4RAtstrerrorR\(RitmemberRTRRQ((s#/usr/local/lib/python2.5/tarfile.pyRHs$


&$cCs|idt|to
|}n|i|}|io|i||Sn|itjo|i||Snb|ip
|i	oCt|i
totdq|i
|i|i|SndSdS(sExtract a member from the archive as a file object. `member' may be
           a filename or a TarInfo object. If `member' is a regular file, a
           file-like object is returned. If `member' is a link, a file-like
           object is constructed from the link's target. If `member' is none of
           the above, None is returned.
           The file-like object is read-only and provides the following
           methods: read(), readline(), readlines(), seek() and tell()
        RDs'cannot extract (sym)link as file objectN(RRRRRt
fileobjectRtSUPPORTED_TYPESRRRxRnR_textractfileRRR4(RiRXR((s#/usr/local/lib/python2.5/tarfile.pyR[)s	


cCs|ddjo|d }ntii|}tii|}|o%tii|oti|n|ip
|io$|idd|i	|i
fn|id|i	|io|i||n|i
o|i||n|io|i||n|ip
|io|i||nc|ip
|io|i||n5|itjo|i||n|i|||i|||ip$|i|||i||ndS(s\Extract the TarInfo object tarinfo to a physical
           file called targetpath.
        iRRis%s -> %sN(RSRTRUtdirnametexiststmakedirsRRRARjRRtmakefileRtmakedirRtmakefifoRRtmakedevtmakelinkRRZtmakeunknownRKRMRL(RiRt
targetpatht	upperdirs((s#/usr/local/lib/python2.5/tarfile.pyRTPs4$



cCsJyti|dWn/tj
o#}|itijoqFnXdS(s,Make a directory called targetpath.
        iN(RStmkdirRUterrnotEEXIST(RiRReRQ((s#/usr/local/lib/python2.5/tarfile.pyR`s
cCsC|i|}t|d}t|||i|idS(s'Make a file called targetpath.
        RN(R[RR6Rl(RiRRetsourcettarget((s#/usr/local/lib/python2.5/tarfile.pyR_s


cCs+|i|||idd|idS(sYMake a file from a TarInfo object with an unknown type
           at targetpath.
        is9tarfile: Unknown file type %r, extracted as regular file.N(R_RAR(RiRRe((s#/usr/local/lib/python2.5/tarfile.pyRdscCs1ttdoti|n
tddS(s'Make a fifo called targetpath.
        tmkfifosfifo not supported by systemN(RfRSRlR\(RiRRe((s#/usr/local/lib/python2.5/tarfile.pyRascCsttdpttdotdn|i}|io|tiO}n|tiO}ti||ti	|i
|idS(s<Make a character or block device called targetpath.
        tmknodRbs'special devices not supported by systemN(RfRSR\RLRR tS_IFBLKtS_IFCHRRmRbRR(RiRReRL((s#/usr/local/lib/python2.5/tarfile.pyRbs"	

cCs!|i}y8|ioti||nti|i|Wntj
o|io4tiitii	|i
|}t|}ny|i|i
||Wqttfj
oS}tii|}yti||Wqtj
o}tdqXqXnXdS(sMake a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
        slink could not be createdN(RRRStsymlinktlinkRSR
RTRKR\RjRURTRRURR5tcopy2R9(RiRRetlinkpathRQ((s#/usr/local/lib/python2.5/tarfile.pyRcs$	

	c
Cstottdortidjo_yti|id}WnOtj
oCyti|i	d}Wqtj
oti
}qXnXyti|id}WnOtj
oCyti
|id}Wqtj
oti}qXnXy_|io'ttdoti|||n(tidjoti|||nWqtj
o}tdqXndS(s6Set owner of targetpath according to tarinfo.
        tgeteuidiitlchowntos2emxscould not change ownerN(R2RfRSRtR4tgetgrnamRRR5RtgetgidtgetpwnamRR3RtgetuidRRutsystplatformRKRUR\(RiRRetgtuRQ((s#/usr/local/lib/python2.5/tarfile.pyRKs,*cCsSttdo?yti||iWqOtj
o}tdqOXndS(sASet file permissions of targetpath according to tarinfo.
        RMscould not change modeN(RfRSRMRLRUR\(RiRReRQ((s#/usr/local/lib/python2.5/tarfile.pyRMs
cCsttdpdSntidjo|iodSny ti||i|ifWn!tj
o}tdnXdS(sBSet modification time of targetpath according to tarinfo.
        RLNtwin32s"could not change modification time(	RfRSR{R|RRLRRUR\(RiRReRQ((s#/usr/local/lib/python2.5/tarfile.pyRLs cCs|id|idj	o|i}d|_|Sn|ii|ixto|iit}|pdSny=t	i
|}|i|_|it7_|i|}Wnztj
on}|i
o3|idd|i|f|it7_qMq/|idjotd|ndSnXPqMW|io |iido
t|_n|io'|iido|id7_n|ii||S(sReturn the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        trais 0x%X: empty or invalid block: %sis(empty, unreadable or compressed file: %sRRN(RRR4RxRRRrR8RRRtproc_memberR$tignore_zerosRAR]RRjRRRRRRJ(RitmR0RRQ((s#/usr/local/lib/python2.5/tarfile.pyRsB
		
	 
!cCsY|ittfjo|i|Sn/|itjo|i|Sn|i|SdS(seChoose the right processing method for tarinfo depending
           on its type and call it.
        N(RRRtproc_gnulongRtproc_sparsetproc_builtin(RiR((s#/usr/local/lib/python2.5/tarfile.pyRDs
cCsL|i|_|ip|itjo|i|i|i7_n|S(soProcess a builtin type member or an unknown member
           which will be treated as a regular file.
        (RRRRRZt_blockRm(RiR((s#/usr/local/lib/python2.5/tarfile.pyROscCsd}|i}xG|djo9|iit}||7}|it7_|t8}qW|iit}ti|}|i|_|it7_|i|}|i|_|it	jot
||_n$|itjot
||_
n|S(sSProcess the blocks that hold a GNU longname
           or longlink member.
        R#i(RmRxR8RRRRRRRRRjRR(RiRR0RtblockR@RGR((s#/usr/local/lib/python2.5/tarfile.pyRYs&	

cCs|i}t}d}d}d}xtdD]}y6t|||d!}t||d|d!}	Wntj
oPnX||jo|it|||n|it||	|||	7}||	}|d7}q1Wt|d}
t|dd!}x|
d	jo|i	i
t}|it7_d
}xtdD]}y6t|||d!}t||d|d!}	Wntj
oPnX||jo|it|||n|it||	|||	7}||	}|d7}qQWt|d}
qW||jo|it|||n||_
|i|_|i|i|i7_||_|S(
s8Process a GNU sparse header plus extra headers.
        iliiiiiiiiii(R0t_ringbufferRR!R$RJt_holeRRRxR8RRRRRRm(RiRR0tspRztlastposRR Rtnumbytest
isextendedtorigsize((s#/usr/local/lib/python2.5/tarfile.pyRvs\		









		cCs2t|t\}}|o|d7}n|tS(s_Round up a byte count by BLOCKSIZE and return it,
           e.g. _block(834) => 1024.
        i(R7R(RiRR>R?((s#/usr/local/lib/python2.5/tarfile.pyRscCs}|i}|djot|}n|i|}x>t|dddD]&}|||ijo||SqOqOWdS(s}Find an archive member by name from bottom to top.
           If tarinfo is given, it is used as the starting point.
        iiN(RR4RtindexRRj(RiRjRRtendR ((s#/usr/local/lib/python2.5/tarfile.pyRs
cCs:x*to"|i}|djoPqqWt|_dS(sWRead through the entire archive file and look for readable
           members.
        N(RrRR4R(RiR((s#/usr/local/lib/python2.5/tarfile.pyRs

cCs\|iotd|iin|dj	o'|i|jotd|indS(snCheck if TarFile is still open, and if the operation's mode
           corresponds to TarFile's mode.
        s%s is closedsbad operation for mode %rN(R{R9RRYR4R(RiRL((s#/usr/local/lib/python2.5/tarfile.pyRs
cCs)|iot|iSnt|SdS(s$Provide an iterator object.
        N(RtiterRtTarIter(Ri((s#/usr/local/lib/python2.5/tarfile.pyRs
cCs%||ijoti|IJndS(s.Write debugging output to sys.stderr.
        N(tdebugR{tstderr(Ritleveltmsg((s#/usr/local/lib/python2.5/tarfile.pyRAsNi((4RYRZR[RRtRRRNR)RRYR4RkRRgRRRRRlRRRR<RrR?RCRDRRRHR[RTR`R_RdRaRbRcRKRMRLRRRRRRRRRRRA(((s#/usr/local/lib/python2.5/tarfile.pyRshCG					
	d3%!	'	0												B		
		<			
		RcBs)eZdZdZdZdZRS(sMIterator Class.

       for tarinfo in TarFile(...):
           suite...
    cCs||_d|_dS(s$Construct a TarIter object.
        iN(RR(RiR((s#/usr/local/lib/python2.5/tarfile.pyRks	cCs|S(s Return iterator object.
        ((Ri((s#/usr/local/lib/python2.5/tarfile.pyRscCs|iip0|ii}|pt|i_tqpn4y|ii|i}Wntj
o
tnX|id7_|S(sReturn the next item using TarFile's next() method.
           When all members have been read, set TarFile as _loaded.
        i(RRRRrt
StopIterationRRt
IndexError(RiR((s#/usr/local/lib/python2.5/tarfile.pyRs
(RYRZR[RkRR(((s#/usr/local/lib/python2.5/tarfile.pyRs		t_sectioncBs eZdZdZdZRS(s$Base class for _data and _hole.
    cCs||_||_dS(N(RRm(RiRRm((s#/usr/local/lib/python2.5/tarfile.pyRks	cCs(|i|jo|i|ijnS(N(RRm(RiR((s#/usr/local/lib/python2.5/tarfile.pyt__contains__s(RYRZR[RkR(((s#/usr/local/lib/python2.5/tarfile.pyRs	RcBseZdZdZRS(s/Represent a data section in a sparse file.
    cCs ti|||||_dS(N(RRkR(RiRRmR((s#/usr/local/lib/python2.5/tarfile.pyRks(RYRZR[Rk(((s#/usr/local/lib/python2.5/tarfile.pyRsRcBseZdZRS(s/Represent a hole section in a sparse file.
    (RYRZR[(((s#/usr/local/lib/python2.5/tarfile.pyR"sRcBs eZdZdZdZRS(sMRingbuffer class which increases performance
       over a regular list.
    cCs
d|_dS(Ni(tidx(Ri((s#/usr/local/lib/python2.5/tarfile.pyRk+scCs|i}xgto_||}||joPn|d7}|t|jo
d}n||ijodSqqW||_|S(Nii(RRrRR4(RiRRtitem((s#/usr/local/lib/python2.5/tarfile.pyR-s	




	(RYRZR[RkR(((s#/usr/local/lib/python2.5/tarfile.pyR's	it
TarFileCompatcBsteZdZdedZdZdZdZdZdZ	dZ
ddd	Zd
Z
dZRS(
sRTarFile class compatible with standard module zipfile's
       ZipFile class.
    RDcCs|tjoti|||_n3|tjoti|||_n
td|dd!djoU|ii}xC|D]7}|i|_	|i
|_ti
|id |_qWndS(Nsunknown compression constantiiRDi(t	TAR_PLAINRRRtTAR_GZIPPEDRR$RRjRVRmt	file_sizeRtgmtimeRt	date_time(RiRRLtcompressionRR((s#/usr/local/lib/python2.5/tarfile.pyRkEs

cCstd|iS(NcSs|iS((Rj(R((s#/usr/local/lib/python2.5/tarfile.pyRXSs(tmaptinfolist(Ri((s#/usr/local/lib/python2.5/tarfile.pytnamelistRscCstd|iiS(NcSs
|itjS((RR(R((s#/usr/local/lib/python2.5/tarfile.pyRXUs(tfilterRR(Ri((s#/usr/local/lib/python2.5/tarfile.pyRTs	cCs|iidS(N(RR?(Ri((s#/usr/local/lib/python2.5/tarfile.pytprintdirWscCsdS(N((Ri((s#/usr/local/lib/python2.5/tarfile.pyttestzipYscCs|ii|S(N(RR(RiRj((s#/usr/local/lib/python2.5/tarfile.pytgetinfo[scCs"|ii|ii|iS(N(RR[RR8(RiRj((s#/usr/local/lib/python2.5/tarfile.pyR8]scCs|ii||dS(N(RRC(RiRVR7t
compress_type((s#/usr/local/lib/python2.5/tarfile.pyR:_sc	Csyddkl}Wn#tj
oddkl}nXddk}|i|_|i|_|i|i	|_
|ii|||dS(Ni(tStringIO(
t	cStringIORR}tcalendarRVRjRRmttimegmRRRRD(RitzinfotbytesRR((s#/usr/local/lib/python2.5/tarfile.pytwritestrascCs|iidS(N(RRl(Ri((s#/usr/local/lib/python2.5/tarfile.pyRlksN(RYRZR[RRkRRRRRR8R4R:RRl(((s#/usr/local/lib/python2.5/tarfile.pyRAs
							
cCs<yt|}|itSWntj
otSnXdS(sfReturn True if name points to a tar archive that we
       are able to handle, else return False.
    N(RgRlRrRRt(RjRG((s#/usr/local/lib/python2.5/tarfile.pyRrs
(dR[t__version__tversiont
__author__t__date__t	__cvsid__t__credits__R{RSR5R RhRR%RGR|R}R4R2R4t__all__RRRRRRRRRRtAREGTYPERRRRRRtCONTTYPERRRRZRtS_IFLNKtS_IFREGRntS_IFDIRRotS_IFIFOtTSUIDtTSGIDtTSVTXtTUREADtTUWRITEtTUEXECtTGREADtTGWRITEtTGEXECtTOREADtTOWRITEtTOEXECRRR!RtR*R3R6RIRQRWRURTt	ExceptionRR\R]R^R_R`RntobjectRuRRRRRRRRRR?RRRRRRg(((s#/usr/local/lib/python2.5/tarfile.pys<module>s

									
					
	
	
		
BL%	1	

Man Man