KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/tarfile.pyc
m
=5Dc
@sdZdZdZdZdZdZdZdkZdkZdk	Z	dk
Z
dkZdkZdk
Z
dkZeidjo
ed	nydkZdkZWnej
oeZZnXd
ddd
gZdZdZedZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(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:d/Z;d0Z<d1Z=d2Z>d3Z?d4Z@d.eAd5ZBd6ZCd7ZDed8ZEe,d9fe-d:fe.d;fe/d<fe0d=fe1d>ffe5d?ffe6d@ffe7e2BdAfe2d fe7dBffe8d?ffe9d@ffe:e3BdAfe3d fe:dBffe;d?ffe<d@ffe=e4BdCfe4dDfe=dBfff
ZFdEZGeiHdFjo
dGZIn
eiJiIZId
eKfdHYZLdIeLfdJYZMdKeLfdLYZNdMeLfdNYZOdOeLfdPYZPdQfdRYZQdSfdTYZRdUeSfdVYZTdWeSfdXYZUdYeSfdZYZVd[eSfd\YZWdeSfd]YZXd
eSfd^YZYd_fd`YZZdafdbYZ[dce[fddYZ\dee[fdfYZ]dge^fdhYZ_diZ`d.ZadjfdkYZbdlZceYidZddS(ms,Read from and write to tar format archives.
s$Revision: 70530 $s0.8.0s!Lars Gustbel (lars@gustaebel.de)s5$Date: 2009-03-22 17:34:05 -0400 (Sun, 22 Mar 2009) $s;$Id: tarfile.py 70530 2009-03-22 21:34:05Z lars.gustaebel $s3Gustavo Niemeyer, Niels Gustbel, Richard Townsend.Ntmacs'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.
    N(tstlengthtlentNUL(RR((t/usr/lib64/python2.4/tarfile.pytstnscCs,|id}|djo|Sn|| S(s?Convert a null-terminated string field to a python string.
    RiN(Rtfindtp(RR((Rtntss

cCs|dtdjo tt|pdd}nJd}x@tt|dD](}|dK}|t||d7}qTW|S(s/Convert a number field to a python number.
    iiRiliN(	RtchrtintRtntxrangeRtitord(RRR ((Rtntis 
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 fieldRtltiiN(RtdigitsRRtposixt
ValueErrortstructtunpacktpackRR R(RR%R&R R((Rtitns&
&cCsTd}x"|d D]}|t|7}qWx"|dD]}|t|7}q6W|S(sCalculate the checksum for a member's header. It's a simple addition
       of all bytes, treating the chksum field as if filled with spaces.
       buf is a 512 byte long string buffer which holds the header.
    iiiN(tchktbuftcR!(R-R.R,((Rtcalc_chksumscCsxdttid|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.
    it148Bit356Biit148bt356bN(tsumR(R)R-tunsigned_chksumt
signed_chksum(R-R6R5((Rtcalc_chksumss77cCs|djodSn|djoti||dSndd}t||\}}xSt
|D]E}|i|}t||jotdn|i|qfW|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 reached(RtNonetshutiltcopyfileobjtsrctdsttBUFSIZEtdivmodtblockst	remainderRtbtreadR-RtIOErrortwrite(R;R<RR=R?R-RAR@((RR:s(




R#t-RAtdR.RtrtwRtxtttTcCskg}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()
    RER$N(tpermtfilemode_tablettabletbittchartmodetappendtjoin(RQRLRPRNRO((Rtfilemodes
	t/cCstii|itidS(NRU(tostpathtnormpathtreplacetsep(RW((Rt<lambda>scBstZdZRS(sBase exception.(t__name__t
__module__t__doc__(((RR stExtractErrorcBstZdZRS(s%General exception for extract errors.(R\R]R^(((RR_#st	ReadErrorcBstZdZRS(s%Exception for unreadble tar archives.(R\R]R^(((RR`&stCompressionErrorcBstZdZRS(s.Exception for unavailable compression methods.(R\R]R^(((RRa)stStreamErrorcBstZdZRS(s=Exception for unsupported operations on stream-like TarFiles.(R\R]R^(((RRb,st
_LowLevelFilecBs2tZdZdZdZdZdZRS(sLow-level file object. Supports reading and writing.
       It is used instead of a regular file object for streaming
       access.
    cCsjhdti<dtitiBtiB<|}ttdo|tiO}nti|||_dS(NRGRHtO_BINARY(RVtO_RDONLYtO_WRONLYtO_CREATtO_TRUNCRQthasattrRdtopentnametselftfd(RlRkRQ((Rt__init__9s0cCsti|idS(N(RVtcloseRlRm(Rl((RRoBscCsti|i|S(N(RVRBRlRmtsize(RlRp((RRBEscCsti|i|dS(N(RVRDRlRmR(RlR((RRDHs(R\R]R^RnRoRBRD(((RRc3s
				t_StreamcBstZdZdZdZdZdZdZdZdZ	dZ
d	d
ZedZ
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.
    cCst|_|djot||}t|_n|djot
|}|i}n|pd|_||_||_	||_||_d|_
d|_t|_|djosy
dk}Wntj
otdnX||_|id|_|djo|iq*|in|djoky
dk}Wntj
otd	nX|djod|_|i|_q|i|_ndS(
s$Construct a _Stream object.
        t*R$ltgzNszlib module is not availableRGtbz2sbz2 module is not available(tTrueRlt_extfileobjtfileobjR8RcRkRQtFalsetcomptypet_StreamProxytgetcomptypetbufsizeR-tpostclosedtzlibtImportErrorRatcrc32tcrct
_init_read_gzt_init_write_gzRttdbuftBZ2Decompressortcmpt
BZ2Compressor(RlRkRQRyRwR|RRt((RRnVsF	


							

	



	cCs-t|do|io|indS(NR~(RiRlR~Ro(Rl((Rt__del__scCs|iid|ii|ii|iid|_tidt	t
i
}|id||i
ido|i
d |_
n|i|i
tdS(s6Initialize for writing with gzip compression.
        i	is<Ls%ss.gziN(RlRtcompressobjtDEFLATEDt	MAX_WBITSt
DEF_MEM_LEVELRR(R*tlongttimet	timestampt_Stream__writeRktendswithR(RlR((RRs
	cCs{|idjo|ii||i|_n|it|7_|idjo|ii	|}n|i
|dS(s&Write string s to the stream.
        RsttarN(RlRyRRRRR}RRtcompressR(RlR((RRDscCsa|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(RlR-RRR|RwRD(RlR((Rt__writescCs
|iodSn|idjo,|idjo|i|ii7_n|idjo|ioz|ii|id|_|idjoJ|iit	i
d|id@|iit	i
d|id@qn|i
p|iint|_dS(s[Close the _Stream object. No operation should be
           done on it afterwards.
        NRHRR$Rss<Ll(RlR~RQRyR-RtflushRwRDR(R*RR}RvRoRu(Rl((RRos
 	#+
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(RlRt
decompressobjRRRt
_Stream__readR`RaR!tflagtxlenRBRuRR(RlRRR((RRs4	
,cCs|iS(s3Return the stream's file pointer position.
        N(RlR}(Rl((RttellsicCs~||idjoWt||i|i\}}x$t|D]}|i|iq@W|i|n
t	d|iS(sXSet the stream's file pointer to pos. Negative seeking
           is forbidden.
        is seeking backwards is not allowedN(
R}RlR>R|R?R@RR RBRb(RlR}R?R R@((Rtseeks
cCs|djoSg}x7to/|i|i}|pPn|i|qWdi	|}n|i|}|i
t|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(RpR8RJRuRlt_readR|R-RRRSR}R(RlRpRJR-((RRBs
cCs|idjo|i|Snt|i}|ig}x_||joQ|i|i}|pPn|i
i|}|i||t|7}q?Wdi
|}|||_|| S(s+Return size bytes from the stream.
        RR$N(RlRyRRpRRR.RJR|R-Rt
decompressRRRS(RlRpR.RJR-((RRs 


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$N(RRlR-R.RJRpRwRBR|RRRS(RlRpR.RJR-((Rt__reads


(R\R]R^RnRRRDRRoRRRR8RBRR(((RRqKs		.		
	
					
	RzcBs2tZdZdZdZdZdZRS(ssSmall proxy class that enables transparent compression
       detection for the Stream interface (mode 'r|*').
    cCs"||_|iit|_dS(N(RwRlRBt	BLOCKSIZER-(RlRw((RRn0s	cCs|ii|_|iS(N(RlRwRBR-(RlRp((RRB4scCs:|iidodSn|iidodSndS(NsRstBZh91RtR(RlR-t
startswith(Rl((RR{8s
cCs|iidS(N(RlRwRo(Rl((RRo?s(R\R]R^RnRBR{Ro(((RRz+s
			t	_BZ2ProxycBsWtZdZddZdZdZdZdZdZdZ	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(RwRlRQtinit(RlRwRQ((RRnMs		cCsadk}d|_|idjo,|i|_|iidd|_n|i	|_dS(NiRGR$(
RtRlR}RQRtbz2objRwRR-R(RlRt((RRRs		
cCs|ig}t|i}x}||joo|ii|i}|pPny|i
i|}Wnt
j
oPnX|i||t|7}qWdi||_|i| }|i||_|it|7_|S(NR$(RlR-RARRIRpRwRBt	blocksizetrawRRtdatatEOFErrorRRRSR}(RlRpRAR-RRIR((RRB\s$


cCs6||ijo|in|i||idS(N(R}RlRRB(RlR}((RRpscCs|iS(N(RlR}(Rl((RRuscCs;|it|7_|ii|}|ii|dS(N(	RlR}RRRRRRwRD(RlRR((RRDxscCsD|idjo#|ii}|ii|n|iidS(NRH(RlRQRRRRwRDRo(RlR((RRo}s(R\R]R^RRnRRBRRRDRo(((RRCs
		
				t_FileInFilecBsStZdZedZdZdZedZdZdZ	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(RwRltoffsetRptsparsetposition(RlRwRRpR((RRns
				cCs|iS(s*Return the current file position.
        N(RlR(Rl((RRscCs
||_dS(s(Seek to a position in the file.
        N(RRl(RlR((RRscCsl|djo|i|i}nt||i|i}|idjo|i|Sn|i|SdS(s!Read data from the file.
        N(RpR8RlRtminRt
readnormalt
readsparse(RlRp((RRBs
cCs9|ii|i|i|i|7_|ii|S(s*Read operation for regular files.
        N(RlRwRRRRpRB(RlRp((RRscCs`g}xJ|djo<|i|}|pPn|t|8}|i|q	Wdi|S(s)Read operation for sparse files.
        iR$N(RRpRltreadsparsesectionR-RRRRS(RlRpR-R((RRs
cCs|ii|i}|djodSnt||i|i|i}t	|t
oQ|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(RlRRRtsectionR8RRpRt
isinstancet_datatrealposRwRRBR(RlRpRR((RRs
 (R\R]R^R8RnRRRBRRR(((RRs		
		tExFileObjectcBsetZdZdZdZedZddZdZdZ	dd	Z
d
ZdZRS(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(NRRGiR$(RttarfileRwttarinfotoffset_dataRptgetattrR8RlRkRQRxR~Rtbuffer(RlRR((RRns				cCs|iotdnd}|ioD|djo|i}d|_qn|i| }|i||_n|djo||ii7}n!||ii|t	|7}|i
t	|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(RlR~R'R-RRpR8RwRBRR(RlRpR-((RRBs


	


 icCs9|iotdnd|ijo|iidd}n|ig}xto|ii	|i
}|i||p
d|joMdi
||_|iidd}|djot|i}nPqSqSW|djot||}n|i| }|i||_|it|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$iiN(RlR~R'RRR}tbuffersRuRwRBRR-RRRSRRpRR(RlRpR-R}R((Rtreadlines,





cCs>g}x1to)|i}|pPn|i|q	W|S(s0Return a list with all remaining lines.
        N(tresultRuRlRtlineRR(RlRR((Rt	readlinesscCs!|iotdn|iS(s*Return the current file position.
        sI/O operation on closed fileN(RlR~R'R(Rl((RR's
icCs|iotdn|djo"tt|d|i|_n|djoJ|djot|i|d|_qt|i||i|_nC|djo)tt|i||id|_n
tdd|_	|i
i|idS(s(Seek to a position in the file.
        sI/O operation on closed fileiiisInvalid argumentR$N(RlR~R'twhenceRtmaxR}RpRRRwR(RlR}R((RR/s

"

 
)	cCs
t|_dS(sClose the file object.
        N(RuRlR~(Rl((RRoDsccs/x(to |i}|pPn|VqWdS(s/Get an iterator over the file's lines.
        N(RuRlRR(RlR((Rt__iter__Is(
R\R]R^RRnR8RBRRRRRoR(((RRs	
	
		cBstZdZddZdZedZedZdZ	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(RkRlRQtuidtgidRptmtimetchksumtREGTYPEttypetlinknametunametgnametdevmajortdevminorRR(RlRk((RRn^s 														cCs d|ii|it|fS(Ns<%s %r at %#x>(Rlt	__class__R\Rktid(Rl((Rt__repr__sscCst|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)iIiQiYiRUsinvalid headerN(RR-RR'tcountRtclsRRRkR"RQRRRpRRRRRRRRtprefixtissparseR7(RR-RR((Rtfrombufvs4		c	Cs+d}|i}d}|iido
t}n|ttfjo
|i}nt	|i}|tjo|d7}n|i
}|ot	|}n|o|it
jotdnt|i
tjotdtnt|tjo|td }x'|o|ddjo|d }qW|t|}|d }|pt|tjotdqqnat|i
tjo||i|i
t7}nt|tjo||i|t7}nt|dt|id	@d
|t|id
|t|id
|t|id|t|id|d|t|i
dttd
ttdt|idt|idt|id
|t|id
|t|dg}|di!|i"t#t$7}t%|t#d}|d d||d}||_|S(s<Return a tar header as a string of 512 byte blocks.
        R$RUsfile is too large (>= 8 GB)slinkname is too long (>%d)iisname is too longidiiis        iii iiis%06oiN('R-RlRRRkRtDIRTYPEtGNUTYPE_LONGNAMEtGNUTYPE_LONGLINKRXRR&RptMAXSIZE_MEMBERR'RtLENGTH_LINKtLENGTH_NAMEt
LENGTH_PREFIXt_create_gnulongRR+RQRRRtMAGICtVERSIONRRRRtpartsRStljustRRR7R(	RlR&RRRRRR-Rk((RttobufsL	


	
	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
././@LongLinkiN(RkRRlRRRRQRRpRR-R>RR?R@(RlRkRR?R-R@R((RRs
			

cCs
|itjS(N(RlRt
REGULAR_TYPES(Rl((RtisregscCs
|iS(N(RlR(Rl((RtisfilescCs
|itjS(N(RlRR(Rl((RtisdirscCs
|itjS(N(RlRtSYMTYPE(Rl((RtissymscCs
|itjS(N(RlRtLNKTYPE(Rl((RtislnkscCs
|itjS(N(RlRtCHRTYPE(Rl((RtischrscCs
|itjS(N(RlRtBLKTYPE(Rl((RtisblkscCs
|itjS(N(RlRtFIFOTYPE(Rl((RtisfifoscCs
|itjS(N(RlRtGNUTYPE_SPARSE(Rl((RR	scCs|itttfjS(N(RlRRRR(Rl((Rtisdevs(R\R]R^RnRtclassmethodRRxRRRRRRRRRRRR(((RRVs 	!K										cBs
tZdZdZeZeZdZeZe	Z
ededZe
ededddZe
dedZe
dedd	Ze
dedd
Zhdd<d
d<dd<ZdZdZdZdZeeedZedZeedZedZdedZddZdZdZdZ 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.ed.Z/d/Z0ed0Z1d1Z2d2Z3RS(3s=The TarFile Class provides an interface to tar archives.
    iRGcCst|djp
|djotdn||_hdd<dd<dd	<||_|pt||i}t|_	nT|djot|d
o
|i}nt|do|i|_nt|_	|ot
ii||_n
d|_||_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'RGtrbtasr+bRHtwbRkRQitawN(RRQR'Rlt_modeRwtfileRkRxRvR8RiRuRVRWtabspathR~tmemberst_loadedRRtinodestfirstmembertnextRR`RR(RlRkRQRwR((RRn$sN 	(

									
iic
	Cs'|o|otdn|djox|iD]}t||i|}|dj	o|i
}ny||d|SWq7tt
fj
o(|dj	o|i|q7q7q7Xq7WtdnCd|jo|idd\}}|pd}|pd}||ijot||i|}nt
d|||||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 openRGsr:*s%file could not be opened successfullyt:iRsunknown compression type %rt|trwsmode must be 'r' or 'w'Rsundiscernible modeN(RGsr:*(RkRwR'RQRt	OPEN_METHRyRtfuncR8Rt	saved_posR`RaRtsplitRTRqR|RJRxRvttaropen(
RRkRQRwR|RRRyRTRJ((RRjjsJ










		
cCs@t|djp
|djotdn||||S(sCOpen uncompressed tar archive name for reading or writing.
        iRsmode must be 'r', 'a' or 'w'N(RRQR'RRkRw(RRkRQRw((RR
s i	cCst|djp
|djotdnydk}|iWn%ttfj
otdnX|djot
||d}ny+|i
|||i||||}Wntj
otdnXt|_|S(skOpen gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        iRsmode must be 'r' or 'w'Nsgzip module is not availableRAsnot a gzip file(RRQR'tgziptGzipFileRtAttributeErrorRaRwR8RRkRR
t
compresslevelRJRCR`RxRv(RRkRQRwRRJR((Rtgzopens" 	
	cCst|djp
|djotdny
dk}Wntj
otdnX|dj	ot||}n|i	||d|}y|i
|||}Wntj
otdnXt|_|S(slOpen bzip2 compressed tar archive name for reading or writing.
           Appending is not allowed.
        iRsmode must be 'r' or 'w'.Nsbz2 module is not availableRsnot a bzip2 file(RRQR'RtRRaRwR8RtBZ2FileRkRRR
RJRCR`RxRv(RRkRQRwRRJRt((Rtbz2opens  

	RR
RsRRtRcCs|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(RlR~RRwRDRRRR>t
RECORDSIZER?R@RvRoRu(RlR?R@((RRos

 
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(Rlt
_getmemberRkRR8tKeyError(RlRkR((Rt	getmember
s

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.
        N(Rlt_checkRt_loadR(Rl((Rt
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().
        N(t_[1]RlRRRk(RlRR((RtgetnamesscCs|id|dj	o
|i}n|djo
|}nt|}tii	|\}}x#|dd!djo|d}qeWt}
|djoAt
tdo|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|i0|
_1n
d|
_1|i2|
_3||
_||
_t4o7yt4i5|
i-d|
_6Wqt7j
oqXnt8o7yt8i9|
i/d|
_:Wq.t7j
oq.Xn|t(t*fjoRt
td	o>t
td
o.ti;|i<|
_=ti>|i<|
_?qn|
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.
        RiiRUtlstatR$iltmajortminorN(@RlRRwR8RktarcnameRXRVRWt
splitdrivetdrvRRRitdereferenceRtstatreststattfstattfilenoRtst_modetstmdtS_ISREGtst_inotst_devtinodetst_nlinkRRRRtS_ISDIRRtS_ISFIFORtS_ISLNKRtreadlinktS_ISCHRRtS_ISBLKRRQtst_uidRtst_gidRtst_sizeRptst_mtimeRtpwdtgetpwuidRRtgrptgetgrgidRRtst_rdevRRR(RlRkRRwR R+RR"RR'R((Rt
gettarinfo%s




	
	+


							 cCs|ix|D]}|ot|iGd|ip|i|ip|i	fG|i
p
|iodd|i|i
fGnd|iGdti|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(RlRRtverboseRTRQRRRRRRRRRpRt	localtimeRRkRRR(RlR=R((Rtlists$

(

cCs|id|djo
|}n|idj	o8tii||ijo|idd|dSn|djoc|oT|djo
d}nx:ti
dD]%}|i|tii
||qWndSn|id||i||}|djo|idd|dSn|io-t|d	}|i|||in|iod|i||oLxIti
|D]4}|itii
||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(RlRRR8RkRVRWRt_dbgt	recursivetlistdirtftaddRSR<RRRtaddfileRoR(RlRkRRBRDR((RREs>


,


'



:cCs|idti|}|i|i}|ii||i	t
|7_	|dj	oxt||i|i
t|i
t\}}|djo&|iitt||d7}n|i	|t7_	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(RlRtcopyRRR&R-RwRDRRR8R:RpR>RR?R@RRRR(RlRRwR?R@R-((RRFs


R@cCs2g}|djo
|}nxT|D]L}|io)|i|ti|}d|_n|i	||q$W|id|ix|D]}t
i
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().
        icCst|i|iS(N(RRRkRA(RRA((RR[sistarfile: %sN(tdirectoriesRR8RlRRRRRGRQtextractRWtsorttreverseRVRSRktdirpathtchowntutimetchmodR_tet
errorlevelRA(RlRWRRPRLRHR((Rt
extractalls0





R$cCsE|idt|to
|}n|i|}|ioti	i
||i|_ny&|i
|ti	i
||iWntj
ok}|idjoqA|idjo|idd|iqA|idd|i|ifnAtj
o4}|idjoqA|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'.
        RGiistarfile: %sstarfile: %s %rN(RlRRtmemberRRRRRVRWRSRt_link_targett_extract_memberRktEnvironmentErrorRPRQtfilenameR8RAtstrerrorR_(RlRSRWRPR((RRIs&


&$cCs|idt|to
|}n|i|}|io|i||Sn|i	t
jo|i||Snb|ip
|ioCt|i
totdq|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()
        RGs'cannot extract (sym)link as file objectN(RlRRRSRRRRt
fileobjectRtSUPPORTED_TYPESRRRwRqRbtextractfileRRR8(RlRSR((RR[9s


cCs|ddjo|d }ntii|}tii|}|o%tii|oti|n|i	p
|i
o$|idd|i
|ifn|id|i
|io|i||n|io|i||n|io|i||n|ip
|io|i||nc|i	p
|i
o|i||n5|itjo|i||n|i|||i|||i
p$|i|||i||ndS(s\Extract the TarInfo object tarinfo to a physical
           file called targetpath.
        iRUis%s -> %sN(t
targetpathRVRWRXtdirnamet	upperdirstexiststmakedirsRRRRlRARkRRtmakefileRtmakedirRtmakefifoRRtmakedevtmakelinkRRZtmakeunknownRMRORN(RlRR\R^((RRU`s6$



cCsJyti|dWn/tj
o#}|itijoqFnXdS(s,Make a directory called targetpath.
        iN(RVtmkdirR\RVRPterrnotEEXIST(RlRR\RP((RRbscCsC|i|}t|d}t|||i|idS(s'Make a file called targetpath.
        RN(	RlR[RtsourceRR\ttargetR:Ro(RlRR\RkRj((RRas

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(RlRaRR\RAR(RlRR\((RRfscCs1ttdoti|n
tddS(s'Make a fifo called targetpath.
        tmkfifosfifo not supported by systemN(RiRVRlR\R_(RlRR\((RRcscCsttdpttdotdn|i}|io|tiO}n|tiO}ti	||ti|i|i
dS(s<Make a character or block device called targetpath.
        tmknodRds'special devices not supported by systemN(RiRVR_RRQRR#tS_IFBLKtS_IFCHRRmR\RdRR(RlRR\RQ((RRds"	

cCs!|i}y8|ioti||nti|i|Wnt	j
o|io4ti
iti
i|i
|}t|}ny|i|i||Wqttfj
oS}ti
i|}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(RRtlinkpathRRVtsymlinkR\tlinkRTR
RWRSR]RkRXRlRURRVRRPR9tcopy2RC(RlRR\RPRp((RRes&	

	cCstottdortidjo_yti|id}WnOt	j
oCyti
|id}Wqt	j
oti}qXnXyti
|id}WnOt	j
oCyti|id}Wqt	j
oti}qXnXy_|io'ttdoti|||n(tidjoti|||nWqtj
o}tdqXndS(s6Set owner of targetpath according to tarinfo.
        tgeteuidiitlchowntos2emxscould not change ownerN(R7RiRVRtR9tgetgrnamRRtgRR:RtgetgidtgetpwnamRtuR8RtgetuidRRuR\tsystplatformRMRVRPR_(RlRR\RPRxR{((RRMs.*cCsSttdo?yti||iWqOtj
o}tdqOXndS(sASet file permissions of targetpath according to tarinfo.
        ROscould not change modeN(	RiRVROR\RRQRVRPR_(RlRR\RP((RROscCsttdpdSntidjo|iodSny ti||i|ifWn!t	j
o}tdnXdS(sBSet modification time of targetpath according to tarinfo.
        RNNtwin32s"could not change modification time(RiRVR}R~RRRNR\RRVRPR_(RlRR\RP((RRNs cCs|id|idj	o|i}d|_|Sn|ii|ixto|ii	t
}|pdSny=ti
|}|i|_|it
7_|i|}Wnztj
on}|io3|idd|i|f|it
7_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: %sRUN(RlRRR8tmRwRRRuRBRR-RRRtproc_memberR'RPtignore_zerosRAR`RRkRRRRRRR(RlRPRR-R((RRs@
		
	 
!cCsY|ittfjo|i|Sn/|itjo|i|Sn|i|SdS(seChoose the right processing method for tarinfo depending
           on its type and call it.
        N(	RRRRRltproc_gnulongRtproc_sparsetproc_builtin(RlR((RRTs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.
        N(	RlRRRRRRZt_blockRp(RlR((RR_s
cCsd}|i}xG|djo9|iit}||7}|i	t7_	|t8}qW|iit}ti|}|i	|_	|i	t7_	|i|}|i	|_	|itjot||_n$|itjot||_n|S(sSProcess the blocks that hold a GNU longname
           or longlink member.
        R$iN(R-RRpRRlRwRBRtblockRRARRRJRRRRRRkRR(RlRRRARR-RRJ((RRis(	

cCs|i}t}d}d}d}xtdD]}	y6t	|||d!}t	||d|d!}Wntj
oPnX||jo|i
t|||n|i
t|||||7}||}|d7}q1Wt|d}
t	|dd!}x|
d	jo|iit}|i
t7_
d
}xtdD]}	y6t	|||d!}t	||d|d!}Wntj
oPnX||jo|i
t|||n|i
t|||||7}||}|d7}qQWt|d}
qW||jo|i
t|||n||_|i
|_|i
|i|i7_
||_|S(s8Process a GNU sparse header plus extra headers.
        iliiiiiiiiiiN(RR-t_ringbuffertspR}tlastposRRR R"RtnumbytesR'RRt_holeRR!t
isextendedtorigsizeRlRwRBRRRRRp(RlRRRRRRR}RR RR-((RRs^		









		cCs2t|t\}}|o|d7}n|tS(s_Round up a byte count by BLOCKSIZE and return it,
           e.g. _block(834) => 1024.
        iN(R>RRR?R@(RlRR?R@((RRs
cCs}|i}|djot|}n|i|}x>t|dddD]&}|||i
jo||SqOqOWdS(s}Find an archive member by name from bottom to top.
           If tarinfo is given, it is used as the starting point.
        iiN(RlRRRR8RtendtindexRR Rk(RlRkRRR R((RRs
cCs:x*to"|i}|djoPqqWt|_dS(sWRead through the entire archive file and look for readable
           members.
        N(RuRlRRR8R(RlR((RRs

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(RlR~RCRR\RQR8R(RlRQ((RRs

cCs)|iot|iSnt|SdS(s$Provide an iterator object.
        N(RlRtiterRtTarIter(Rl((RRs
cCs%||ijoti|IJndS(s.Write debugging output to sys.stderr.
        N(tlevelRltdebugR}tstderrtmsg(RlRR((RRAs(4R\R]R^RRxR!RRQR&RRYR8RnRRjR
RRRRoRRRR<RuR?RERFRRRIR[RURbRaRfRcRdReRMRORNRRRRRRRRRRRA(((RRsZFH!				
	d3%!	'	0												B		
		<			
		RcBs)tZdZdZdZdZRS(sMIterator Class.

       for tarinfo in TarFile(...):
           suite...
    cCs||_d|_dS(s$Construct a TarIter object.
        iN(RRlR(RlR((RRns	cCs|S(s Return iterator object.
        N(Rl(Rl((RR	scCs|iip0|ii}|pt|i_tqpn4y|ii|i}Wnt	j
o
tnX|id7_|S(sReturn the next item using TarFile's next() method.
           When all members have been read, set TarFile as _loaded.
        iN(
RlRRRRRut
StopIterationRRt
IndexError(RlR((RR
s
(R\R]R^RnRR(((RRs		t_sectioncBs tZdZdZdZRS(s$Base class for _data and _hole.
    cCs||_||_dS(N(RRlRp(RlRRp((RRn%s	cCs(|i|jo|i|ijnS(N(RlRRp(RlR((Rt__contains__(s(R\R]R^RnR(((RR"s	RcBstZdZdZRS(s/Represent a data section in a sparse file.
    cCs ti|||||_dS(N(RRnRlRRpR(RlRRpR((RRn.s(R\R]R^Rn(((RR+sRcBstZdZRS(s/Represent a hole section in a sparse file.
    (R\R]R^(((RR2sRcBs tZdZdZdZRS(sMRingbuffer class which increases performance
       over a regular list.
    cCs
d|_dS(Ni(Rltidx(Rl((RRn;scCs|i}xgto_||}||joPn|d7}|t|jo
d}n||ijodSqqW||_|S(Nii(RlRRutitemRRR8(RlRRR((RR=s	




	(R\R]R^RnR(((RR7s	it
TarFileCompatcBsttZdZdedZdZdZdZdZdZ	dZ
eed	Zd
Z
dZRS(sRTarFile class compatible with standard module zipfile's
       ZipFile class.
    RGcCs|tjoti|||_n3|tjoti	|||_n
t
d|dd!djoU|ii}xC|D]7}|i|_|i|_ti|id |_qWndS(Nsunknown compression constantiiRGi(tcompressiont	TAR_PLAINRR
RRQRlRtTAR_GZIPPEDRR'RRRRkRWRpt	file_sizeRtgmtimeRt	date_time(RlRRQRRR((RRnUs

cCstd|iS(NcCs|iS(N(RRk(R((RR[cs(tmapRltinfolist(Rl((RtnamelistbscCstd|iiS(NcCs
|itjS(N(RRR(R((RR[es(tfilterRlRR(Rl((RRds	cCs|iidS(N(RlRR?(Rl((RtprintdirgscCsdS(N((Rl((RttestzipiscCs|ii|S(N(RlRRRk(RlRk((RtgetinfokscCs"|ii|ii|iS(N(RlRR[RRkRB(RlRk((RRBmscCs|ii||dS(N(RlRRERWR(RlRWRt
compress_type((RRDoscCsydkl}Wn tj
odkl}nXdk}|i|_|i|_|i	|i
|_|i
i|||dS(N(sStringIO(t	cStringIOtStringIORtcalendartzinfoRWRkRRpttimegmRRRlRRFtbytes(RlRRRR((Rtwritestrqs	cCs|iidS(N(RlRRo(Rl((RRo{s(R\R]R^RRnRRRRRRBR8RDRRo(((RRQs
							
cCs<yt|}|itSWntj
otSnXdS(sfReturn True if name points to a tar archive that we
       are able to handle, else return False.
    N(RjRkRJRoRuRRx(RkRJ((RRs
(eR^t__version__tversiont
__author__t__date__t	__cvsid__t__credits__R}RVR9R#RhRR(RGR~RR9R7R8t__all__RRRRRRRRRRtAREGTYPERRRRRRtCONTTYPERRRRZRtS_IFLNKtS_IFREGRntS_IFDIRRotS_IFIFOtTSUIDtTSGIDtTSVTXtTUREADtTUWRITEtTUEXECtTGREADtTGWRITEtTGEXECtTOREADtTOWRITEtTOEXECRRR"RxR+R/R7R:RMRTRZRXRWt	ExceptionRR_R`RaRbRcRqtobjectRzRRRRRRRRRR?RRRRRRj([R+RaR(RRRcRRRqRRRRRoR7RRRRRbRzRRRRRR:RRRnRRRRRR/RRR"R`RMRRRVRRRRRRjRRRRhRRRRZRR7RRRGRRRTRR9RRRR_RRRR#RRR}RRRRRR9RRRXRRR((Rt?s								

*						
	
DL%	1	

Anon7 - 2021