-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/export/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pyc

ó
î:ïNc@@sÜdZddlmZddlZddlZddlZddlZddlmZm	Z	ddl
mZdd„Z
ddd„Zddd„Zddd	„Zdddd
„Zddd„Zdddd
„ZdS(sExport a tree to a tarball.i(tabsolute_importN(terrorstosutils(t_export_iter_entriesc
C@s‘tj||ƒjdƒ}tj|ƒ}|d
k	rB||_n|j|j|ƒ|_|j	dkrÕtj
|_|j|j|ƒr–d|_
n	d|_
|j|j|ƒ}t|ƒ|_tj|ƒ}	n²|j	dkrtj|_|jd7_d|_d|_
d
}	nm|j	dkrhtj|_d|_d|_
|j|j|ƒ|_d
}	ntjd	|j|j	fƒ‚||	fS(sRPrepare a tarball item for exporting

    :param tree: Tree to export
    :param final_path: Final path to place item
    :param tree_path: Path for the entry in the tree
    :param entry: Entry to export
    :param force_mtime: Option mtime to force, instead of using tree
        timestamps.

    Returns a (tarinfo, fileobj) tuple
    tutf8tfileiíi¤t	directoryt/itsymlinks(don't know how to export {%s} of kind %rN(RtpathjointencodettarfiletTarInfotNonetmtimetget_file_mtimetfile_idtkindtREGTYPEttypet
is_executabletmodet
get_file_texttlentsizetStringIOtDIRTYPEtnametSYMTYPEtget_symlink_targettlinknameRtBzrError(
ttreetroott
final_patht	tree_pathtentrytforce_mtimetfilenametitemtcontenttfileobj((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pytprepare_tarball_item!s8								c
c@soz]xVt||ƒD]E\}}}t||||||ƒ\}}	|j||	ƒdVqWWd|jƒXdS(sÕExport tree contents to a tarball.

    :returns: A generator that will repeatedly produce None as each file is
        emitted.  The entire generator must be consumed to complete writing
        the file.

    :param tree: Tree to export

    :param ball: Tarball to export to; it will be closed when writing is
        complete.

    :param subdir: Sub directory to export

    :param force_mtime: Option mtime to force, instead of using tree
        timestamps.
    N(RR*taddfiletclose(
R tballR!tsubdirR%R"R#R$R'R)((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pytexport_tarball_generatorRs
cc@s¨ddl}|dk	r!|}nxt|ddƒrit|ddƒri|jj|jƒƒ}|j}n0|jƒdk	r“|j|jƒƒ}nd}t	}	d}
|dk	rº|}n?|dkrØt
j}t}	n!t
|dƒ}tjj|ƒ}
y"|j|
dd|d	|ƒ}Wn)tk
rF|j|
dd|ƒ}nXtj
dd
d|ƒ}
x%t||
|||ƒD]}dVqxW|jƒ|	s¤|jƒndS(s«Export this tree to a new tar file.

    `dest` will be created holding the contents of this tree; if it
    already exists, it will be clobbered, like with "tar -c".
    iNt
repositorytget_revision_idt-twbtwR)Rsw|(tgzipR
tgetattrR0tget_revisionR1t	timestamptget_root_idRtFalsetsyststdouttTruetopentostpathtbasenametGzipFilet	TypeErrorRR/R,(R tdestR!R.R%R)R5t
root_mtimetrevt	is_stdoutRAtstreamt	zipstreamR-t_((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pyttgz_exporter_generatorms>				

	
cC@s|dk	r$tjdd|ƒ}nE|dkrKtjddtjƒ}ntj|jtjƒdƒ}t|||||ƒS(s«Export this tree to a new tar file.

    `dest` will be created holding the contents of this tree; if it
    already exists, it will be clobbered, like with "tar -c".
    sw|bz2R2sw:bz2N(	R
RR>R;R<R
Rt_fs_encR/(R RDR!R.R%R)R-((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pyttbz_exporter_generatorŸsc	C@sg|dk	r|}n'|dkr-tj}nt|dƒ}tjdd|ƒ}t|||||ƒS(s«Export this tree to a new tar file.

    `dest` will be created holding the contents of this tree; if it
    already exists, it will be clobbered, like with "tar -c".
    R2R3sw|N(R
R;R<R>RR/(	R RDR!R.tcompressionR%R)RHR-((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pytplain_tar_exporter_generatorµs	cC@st||||||dƒS(Ntxz(ttar_lzma_exporter_generator(R RDR!R.R%R)((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pyttar_xz_exporter_generatorÇstalonecC@sÐ|dkrtjdƒ‚n|dk	r<tjdƒ‚nyddl}Wn%tk
rs}tjd|ƒ‚nX|j|jtj	ƒddi|d	6ƒ}	t
jdd
d|	ƒ}
t||
||d|ƒS(
s±Export this tree to a new .tar.lzma file.

    `dest` will be created holding the contents of this tree; if it
    already exists, it will be clobbered, like with "tar -c".
    R2s-Writing to stdout not supported for .tar.lzmas1Writing to fileobject not supported for .tar.lzmaiNtlzmaR4toptionstformatsw:R)R%(
RRR
RTtImportErrortDependencyNotPresenttLZMAFileR
RRLRR>R/(R RDR!R.R%R)tcompression_formatRTteRHR-((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pyRQÍs(t__doc__t
__future__RR?RR;RtbzrlibRRt
bzrlib.exportRR
R*R/RKRMRORRRQ(((s>/usr/lib/python2.7/dist-packages/bzrlib/export/tar_exporter.pyt<module>s"12

Copyright © 2017 || Recoded By Mr.Bumblebee