ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/yum/
Upload File :
Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/yum/metalink.pyc

�
8M�bc@sddlZddlZddlZddlmZddlZddlmZdej	fd��YZ
dZdZied6ed	6Z
d
e
Zde
Zde
Zd
dd��YZddd��YZddd��YZd�Zedkr�e�ndS(i����N(t
format_number(tcElementTree_xmlparsetMetaLinkRepoErrorParseFailcBseZdZRS(s< An exception thrown for an unparsable MetaLinkRepoMD file. (t__name__t
__module__t__doc__(((s0/usr/lib/python2.7/site-packages/yum/metalink.pyRsshttp://www.metalinker.org/s%http://fedorahosted.org/mirrormanagertmltmms{%(ml)s}files/{%(ml)s}files${%(mm)s}alternates/{%(mm)s}alternates{%(ml)s}resourcestMetaLinkFilecBs}eZdZd�Zd�Zd�Zee�Zd�Zee�Z	d�Z
ee
�Zd�Zee�Z
d�ZRS(s1 Parse the file metadata out of a metalink file. cCsQtddddg�}x�|D]�}tr.q|jdtkrVt|j�|_q|jdtkr~t|j�|_q|jdtkri|_	x[|D]P}|jdtkr�|j
d	�|kr�|j|j	|j
d	�j�<q�q�WqqWt|d
�st
d�nt|d�s2t
d
�nt|d�sMt
d�ndS(Ntmd5tsha1tsha256tsha512s
{%s}timestamps{%s}sizes{%s}verifications{%s}hashttypet	timestampsNo timestamp for filetsizesNo size for filetchksumssNo verifications for file(tsettFalsettagt
__XML_NS_MM__tintttextRt
__XML_NS_ML__RRtgettlowerthasattrR(tselftelemRtcelemthelem((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt__init__5s(
	
-cCsAdtj|j�t|j�|j|j|j|j|jfS(NsZTimestamp: %s
Size:      %5s (%d)
MD5:       %s
SHA1:      %s
SHA256:    %s
SHA512:    %s
(	ttimetctimeRRRR	R
RR(R((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt__str__Ms$cCs|jjdd�S(NR	t(RR(R((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt_get_md5XscCs|jjdd�S(NR
R#(RR(R((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt	_get_sha1[scCs|jjdd�S(NRR#(RR(R((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt_get_sha256^scCs|jjdd�S(NRR#(RR(R((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt_get_sha512ascCs�|dkrdSt|j|j�}|r0|St|j|j�}|rO|St|j|j�}|rn|St|j|j�}|r�|St|j|j�}|r�|St|j|j�}|r�|SdS(Nii(tNonetcmpRRR	R
RR(Rtothertret((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt__cmp__es*(RRRRR"R$tpropertyR	R%R
R&RR'RR,(((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR2s						tMetaLinkURLcBs2eZdZd�Zd�Zd�Zd�ZRS(s0 Parse the URL metadata out of a metalink file. cCs�|jdtkst�||_|j|_t|jdd��|_|jd�|_	|jd�|_
|jdtd�|_|jj
�dk|_|j	dkr�|jd	�|_	ndS(
Ns{%s}urlt
preferencei����R
tlocations{%s}privatetfalsettruetprotocol(RRtAssertionErrortmax_connectionsRturlRRR/R3R0RtprivateRR((RRR5((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR�s	cCs,d|j|j|j|j|j|jfS(NsxURL:             %s
Preference:      %d
Max-Connections: %d
Protocol:        %s
Location:        %s
Private:         %s
(R6R/R5R3R0R7(R((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR"�scCs�|dkrdSt|j|j�}|r0|St|jdk|jdk�}|r\|St|jdk|jdk�}|r�|St|j|j�S(Nithttpsthttp(R(R)R/R3R6(RR*R+((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR,�s!!cCs$|jdkrtS|js tStS(N(R3R(RR6tTrue(R((s0/usr/lib/python2.7/site-packages/yum/metalink.pytusable�s
	(RRRRR"R,R;(((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR.}s
			tMetaLinkRepoMDcBs)eZdZd�Zd�Zd�ZRS(s' Parse a metalink file for repomd.xml. c	
Cs8d|_d|_g|_g|_i|_tjj|�sOt	d|�nyt
|�}Wntk
rt	d|�nXx[|jt
�D]J}|jd�}tjj|�dkr�q�n|jdk	r�|j|kr�t	d�n||_t|�}|jdk	r,|j|kr,t	d�n||_x-|jt�D]}|jjt|��qEWxr|jt�D]a}t|jd�p�d�}x=|D]5}|jd	tkr�|jjt||��q�q�WquWq�W|jj�|jj�|jdkrt	d
�nt|j�dkr4t	d�ndS(
NsFile %s does not existsFile %s is not XMLtnames
repomd.xmlsDifferent paths for repomd filesDifferent data for repomd filetmaxconnectionsis{%s}urlsNo repomd fileis	No mirror(R(R=trepomdtold_repomdstmirrorst_host2mctostpathtexistsRtxmlparsetSyntaxErrortfindallt__ML_FILE_ELEMENT__RtbasenameRt__ML_OLD_FILE_ELEMENTS__tappendt__ML_RESOURCES__RRRR.tsorttlen(	RtfilenametrootRR=R?RR5tuelem((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR�sF					
		
(

ccs�d�}x�|jD]�}|j}|jd�r4na|jd�sa|jd�sa|jd�r||�}||jkr�qn||j|<nq|jd�s�qn|td� VqWdS(s> Iterate plain urls for the mirrors, like the old mirrorlist. cSs|jd�djd�dS(Nt/it@i����(tsplit(R6((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt<lambda>�ssfile:shttp:sftp:shttps:s/repodata/repomd.xmlN(RAR6t
startswithRBtendswithRO(Rturl2hosttmirrorR6thost((s0/usr/lib/python2.7/site-packages/yum/metalink.pyturls�s		cCs�t|j�}t}xU|jD]J}|s@|ddd7}n|rS|d7}nt}|t|�7}qWt}xU|jD]J}|s�|ddd7}n|r�|d7}nt}|t|�7}q}W|S(Ns%s
t-iOs
(tstrR?RR@R:RA(RR+tdonetorepomdR6((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR"�s$

(RRRRR\R"(((s0/usr/lib/python2.7/site-packages/yum/metalink.pyR<�s	-	cCs~d�}ttj�dkr(|�nxOtjdD]@}tjj|�s]dG|GHq6ndG|GHt|�GHdGHq6WdS(s MetaLinkRepoMD test function. cSs)tjdtjdIJtjd�dS(NsUsage: %s <metalink> ...ii(tsyststderrtargvtexit(((s0/usr/lib/python2.7/site-packages/yum/metalink.pytusagesiis
No such file:sFile:R#N(RORaRcRCRDRER<(ReRP((s0/usr/lib/python2.7/site-packages/yum/metalink.pytmain
s	
		t__main__((((RaRCR turlgrabber.progressRtErrorstyum.miscRRFt	RepoErrorRRRt__XML_FMT__RIRKRMRR.R<RfR(((s0/usr/lib/python2.7/site-packages/yum/metalink.pyt<module>s&




K2^	

Zerion Mini Shell 1.0