ok

Mini Shell

Direktori : /opt/alt/python33/lib/python3.3/site-packages/setuptools/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyc

�
�/{Yc@s?ddlZddlZddlZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZyddlZWn ek
r�ddljZnXddlmZmZeeddd�Zd�Zd	�Zd
�Zd�Zd�Ze�Z dd
�Z!d�Z"dd�Z#d�Z$d�Z%de&fd��YZ'de'fd��YZ(de(fd��YZ)de'fd��YZ*dd�Z+de&fd��YZ,de,fd��YZ-d e,fd!��YZ.e/d"kr;x#e+ej0d#�D]Z1e1GHq)WndS($i����N(tlog(tunicode(tunescape(tPopentPIPEic	Csly;t|d|d|dtjdk�}|j�|}Wntk
rOdSXt||�}|j|fS(Ntstdouttstderrtshelltwin32it(iR	(t_PopentsystplatformtcommunicatetOSErrortdecode_as_stringt
returncode(targsRRtencodingtstreamtproctdata((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt_run_commands
cCsK|jd�d}djg|jD]!}|j|jkr#|j^q#�S(NtscheduleiR	(tgetElementsByTagNametjoint
childNodestnodeTypet	TEXT_NODEt	nodeValue(tentryRtt((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt_get_entry_schedule0s	
cCsK|jd�d}djg|jD]!}|j|jkr#|j^q#�S(NtpropertyiR	(RRRRRR(ttargett
property_textR((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt_get_target_property7s	
cCs+tjdkr!|jd�}n|}|S(Niisutf-8(ii(Rtversion_infotencode(tdecoded_strR((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt
_get_xml_data>scGs6|s|dkr#tjj|�Stjj||�S(Nt.(tostpathR(tprefixtsuffix((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytjoinpathGscCs�yLtj�}|s"|dkr5tj�d}n|rKtj|�nWn tjtfk
rnd}nXtj	dk}|s�ddg|S|j
d�r�|r�dS|SdS(NsUS-ASCIIitdarwinsutf-8smac-(tlocaletgetpreferredencodingtgetdefaultlocaletcodecstlookuptErrortLookupErrortNoneRRt
startswith(Rtis_osx((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytdetermine_console_encodingLs
cCsL|dkrt}nt|t�s6|j|�}ntjd|�}|S(s�
    Decode the console or file output explicitly using getpreferredencoding.
    The text paraemeter should be a encoded string, if not no decode occurs
    If no encoding is given, getpreferredencoding is used.  If encoding is
    specified, that is used instead.  This would be needed for SVN --xml
    output.  Unicode is explicitly put in composed NFC form.

    --xml should be UTF-8 (SVN Issue 2938) the discussion on the Subversion
    DEV List from 2007 seems to indicate the same.
    tNFCN(R7t_console_encodingt
isinstanceRtdecodetunicodedatat	normalize(ttextR((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyRis
	cCs�tjjjt|��}t�}x||D]t\}}|dkr+|jdkr+|j|�t|�j	d�s�|j
|jd�|jd�f�q�q+q+W|dS(s+Parse the entries from a recursive info xmlt
START_ELEMENTRtdeleteR+tkindi(txmltdomtpulldomtparseStringR(tlisttnodeNamet
expandNodeR R8tappendtgetAttribute(R'tdoctentriesteventtnode((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytparse_dir_entries�s	
R	c	Cstjj|�}tjj|�}tjjjt|��}t	�}x�|D]�\}}|dkrO|j
dkrO|j|�tjj|jd��}tjj|�j
|�r�|t|�d}nt|�}x-t|�D]}|jt||��q�WqOqOW|S(s!Parse a propget svn:externals xmlRBR"R+i(R*R+tnormpathtnormcaseRERFRGRHR(RIRJRKRMR8tlenR$tparse_external_propRLR.(	R'R,RNt	externalsRPRQR+Rtexternal((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytparse_externals_xml�s	
!cCs�g}x�|j�D]�}|j�}|s1qntjdkrR|jd�}ntj|�}tjdkr�g|D]}|jd�^qw}ntj	|d�dr�|d}n
|d}t
|dd�}|jtj
j|��qW|S(s�
    Parse the value of a retrieved svn:externals entry.

    possible token setups (with quotng and backscaping in laters versions)
        URL[@#] EXT_FOLDERNAME
        [-r#] URL EXT_FOLDERNAME
        EXT_FOLDERNAME [-r#] URL
    iisutf-8i����R(ii(ii(t
splitlinestlstripRR%R&tshlextsplitR>turlparseturlsplitRRLR*R+RS(tlinesRWtlinetxRX((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyRV�s 	%

c	Cs�t}t|d�}d}z�x�t|jd�D]}|j�}t|�dkr1|\}}|jt|��}|dkr�||kr�t}q�|dkr�|r�Pq�q1q1WWd|j	�X|S(NtrtR	itKtV(
tFalsetopentitertreadlineR]RUtreadtinttTruetclose(	tfilenametkeytfoundtfRRatpartsRDtlength((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytparse_prop_file�s	tSvnInfocBs�eZdZed��Zejdej�Ze	dd��Z
dd�Zd�Ze
d��Ze
d��Zd	�Zd
�Zed�Zd�Zd
�ZRS(s�
    Generic svn_info object.  No has little knowledge of how to extract
    information.  Use cls.load to instatiate according svn version.

    Paths are not filesystem encoded.
    cCs?tdddg�\}}|dkr7|r7|j�SdSdS(Ntsvns	--versions--quietiR	(Rtstrip(tcodeR((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytget_svn_version�s
s!(?:([\-0-9]+):)?(\d+)([a-z]*)\s*$R	c	Cs^tjj|�}tdd|g�\}}tjj|d�}tjjtjj|d��p�tjjtjj|d��p�tjjtjj|d��}t|j�jd��}ytd�|d	 D��}Wnt	k
r�t�}nX|st
|�S|s$|s$|dkr>tjdt
�t|�S|dkrTt|�St|�S(NRvtinfos.svnROs	dir-propss
dir-prop-baseR)css|]}t|�VqdS(N(Rk(t.0Rb((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pys	<genexpr>siiis?No SVN 1.3+ command found: falling back on pre 1.7 .svn parsingi(ii(ii(R*R+RSRRtisfilettupleRyR]t
ValueErrorRutwarningstwarntDeprecationWarningtSvnFileInfot	Svn13Infot	Svn15Info(	tclstdirnametnormdirRxRtsvn_dirthas_svntsvn_versiontbase_svn_version((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytload�s(!!!


	

cCs||_d|_d|_dS(N(R+R7t_entriest
_externals(tselfR+((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt__init__s		cCshtdd|jg�\}}|r5tjd�dS|jj|�}|r`t|jd��SdSdS(s<Retrieve the directory revision informatino using svnversiont
svnversions-cssvnversion failediiN(RR+RR�trevision_retmatchRktgroup(R�RxRtparsed((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytget_revisions
cCs(|jdkr!|j�|_n|jS(N(R�R7tget_entries(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyRO(scCs(|jdkr!|j�|_n|jS(N(R�R7t
get_externals(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyRW.sccsx|jD]}|Vq
WdS(sR
        Iterate over the svn:external references in the repository path.
        N(RW(R�titem((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytiter_externals4sccs8x1|jD]&\}}|j�dkr
|Vq
q
WdS(sR
        Iterate over the non-deleted file entries in the repository path
        tfileN(ROtlower(R�R�RD((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt
iter_files;sccsI|r|jVnx1|jD]&\}}|j�dkr|VqqWdS(sR
        Iterate over the non-deleted file entries in the repository path
        tdirN(R+ROR�(R�tinclude_rootR�RD((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt	iter_dirsCs
cCsgS(N((R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�MscCsgS(N((R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�Ps(t__name__t
__module__t__doc__tstaticmethodRytretcompiletIR�tclassmethodR�R�R�R!RORWR�R�RlR�R�R�(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyRu�s
	
		
	R�cBseZd�Zd�ZRS(cCsKtdddd|jgdd�\}}|rAtjd�gSt|�S(NRvRzs-Rs--xmlRsutf-8ssvn info failed(RR+RtdebugRR(R�RxR((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�Us
cCs�dddg}g}x�|j�D]�}t||gdd�\}}|dkrdtjd�gSxKt|�D]=}|r�tjj||�}n|jtjj	|��qqWq"W|S(NRvtpropgets
svn:externalsRsutf-8issvn propget failed(
R�RRR�RVR*R+RRLRS(R�tcmdtresulttfolderRxR`RX((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�_s
!(R�R�R�R�(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�Ts	
R�cBseZd�ZRS(cCsiddd|jddg}t|dd�\}}|rJtjd�gSt|d	tjj|j��S(
NRvR�s
svn:externalss-Rs--xmlRsutf-8ssvn propget failedR,(R+RRR�RYR*tabspath(R�R�RxR`((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�ss
(R�R�R�(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�rsR�cBsAeZdd�Zd�Zd�Zd�Zd�Zd�ZRS(R	cCs,tt|�j|�d|_d|_dS(N(tsuperR�R�R7t_directoriest	_revision(R�R+((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�~s	ccs�t|dd�}tjj|�r�tj|�}|t|j�fVx�|j�D]x}t	|�}t||�}tjj|�r�|t
dfVqTtjj|�rTx|j
|�D]}|Vq�WqTqTWndS(Ns.svnRO(R.R*R+R|tSVNEntriesFileR�Rftparse_revisiontget_undeleted_recordsRRlR7tisdirt	_walk_svn(R�tbaset
entry_fileROR+R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��scCs�t�}d}xa|j|j�D]M\}}}|rM|j|df�q"|j|df�t||�}q"W||_||_dS(NiR�R�(RIR�R+RLtmaxR�R�(R�ROtrevR+R|tdir_rev((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt_build_entries�s	"	cCs#|jdkr|j�n|jS(N(R�R7R�(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��s
cCs#|jdkr|j�n|jS(N(R�R7R�(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��s
cCs�ddgddgg}g}x�|j�D]�}d}x8|D]0}t||�}tjj|�r>|}q>q>W|dk	r+t|d�}t|dd�}|jt	|��q+q+W|S(Ns.svns
dir-prop-bases	dir-propss
svn:externalsRsutf-8(
R�R7R.R*R+R|RtRtextendRV(R�t
prop_filesRWR�t	prop_filet	rel_partsRntext_prop((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��s	

(R�R�R�R�R�R�R�R�(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�|s				ccsqtj|�}x|j�D]}|VqWx?|j�D]1}tj|�}x|j�D]}|VqZWq8WdS(N(RuR�R�R�(R�RzR+tsub_infotsub_path((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt
svn_finder�s	R�cBs8eZd�Zed��Zed��Zd�ZRS(cCs
||_dS(N(R(R�R((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��scCsItjj|dd�}t|�}ztj|�}Wd|j�X|S(Ns.svnRO(R*R+RRgR�RjRm(tclass_R�RnRqR�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��scCs5|j�}|jd�}ttg|}||�S(Ns<?xml(RjR8tSVNEntriesFileTexttSVNEntriesFileXML(R�tfileobjRtis_xml((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyRj�scCs|j�dg}t|�S(Ni(tparse_revision_numbersR�(R�tall_revs((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��s(R�R�R�R�R�RjR�(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��s	
R�cBsYeZidd6dd6dd6Zd�Zd�Zd�Zd	�Zd
�Zd�ZRS(is1.4.xi	s1.5.xi
s1.6.xcCs|jS(N(tsections(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt__get_cached_sections�scCs�d}|jj|�}gttj|�D]}|^q+}yEt|djd��}||jj�kr�t	j
d|�nWntk
r�dSX||_|j
|_|jS(Ns
isUnknown subversion verson %d(RR]tmaptstrRZRktpoptknown_svn_versionstvaluesRR�R~R�t(_SVNEntriesFileText__get_cached_sectionstget_sections(R�tSECTION_DIVIDERR�RbR�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��s%
	cCst|j��S(N(tboolR�(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytis_valid�scCs|j�ddS(Nii(R�(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pytget_urlscCsOd}g|j�D]2}t|�|kr||rt||�^q}|S(Ni	(R�RURk(R�trevision_line_numbertsectiontrev_numbers((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�s cCs<d�}g|j�D]}||�r|d^q}|S(NcSs0|o/|do/t|�dkp/|ddkS(NiiiRC(RU(ts((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt<lambda>si(R�(R�t	undeletedR�R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�s
	(	R�R�R�R�R�R�R�R�R�(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR��s
					
R�cBs,eZd�Zd�Zd�Zd�ZRS(cCstS(N(Rl(R�((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�scCs(tjd�}|j|j�jd�S(sGet repository URLs
url="([^"]+)"i(R�R�tsearchRR�(R�turlre((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�scCsAtjd�}g|j|j�D]}t|jd��^q"S(Nscommitted-rev="(\d+)"i(R�R�tfinditerRRkR�(R�trevretm((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�!scCsMtjdtj�}g|j|j�D]}t|jd��^q(}|S(Ns%name="([^"]+)"(?![^>]+deleted="true")i(R�R�R�R�RRR�(R�tentries_patternR�tresults((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�(s1(R�R�R�R�R�R�(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyR�s			t__main__i(2R*R�Rt	distutilsRtxml.dom.pulldomRER\R0R3R?Rtsetuptools.compatRtxml.sax.saxutilsRR^tImportErrorturllib.parsetparset
subprocessRR
Rt_PIPER7RR R$R(R.R:R<RRRRYRVRttobjectRuR�R�R�R�R�R�R�R�targvtname(((sE/opt/alt/python33/lib/python3.3/site-packages/setuptools/svn_utils.pyt<module>sN
									$	t
B
3

Zerion Mini Shell 1.0