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/repoMDObject.pyc

�
8M�bc@s�ddlmZddlmZmZddlmZddlZddlZddl	m
Z
mZd�Zdd
d��YZ
d	dd
��YZd�Zedkr�e�ndS(i����(tcElementTree_iterparse(t_available_compressiontstat_f(tRepoMDErrorN(tAutoFileChecksumstto_xmlcCs*|jd�dkr|S|jd�dS(Nt}i����i(tfindtsplit(tqn((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyt
ns_cleanupstRepoDatacBs5eZdZdd�Zd�Zd�Zd�ZRS(s(represents anything beneath a <data> tagcCs�d|_|r'|jjd�|_nd|_d|_d|_d|_d|_d|_	d|_
g|_|r�|j|�ndS(Nttype(NN(NN(NN(
tNoneRtattribtgettlocationtchecksumtopenchecksumt	timestampt	dbversiontsizetopensizetdeltastparse(tselftelem((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyt__init__s									c	Cs{xt|D]l}t|j�}|dkr^|jjd�}|jjd�}||f|_q|dkr�|j}|jjd�}||f|_q|dkr�|j}|jjd�}||f|_q|dkr�|j|_q|dkr|j|_	q|d	kr!|j|_
q|d
kr<|j|_q|dkrt|�}|j
|_
|jj|�qqWdS(NRthreftbaseRRs
open-checksumRtdatabase_versionRs	open-sizetdelta(R
ttagRRRttextRRRRRRRRRtappend(	RRtchildt
child_nametrelativeRt
csum_valuet	csum_typeR((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyR/s4
		cCs�d}dt|jdt�}||7}x�ddgD]t\}}t||�r6t||�}|dr�d|t|ddt�t|d	�|f}||7}q�q6q6Wt|d
�r=t|d
�}|d	r=dt|d	dt�}|dr-dt|ddt�t|d	dt�f}n||7}q=nx[ddddgD]G\}}t||�}|rPd|t|�|f}||7}qPqPWxD|jD]9}dj|j�jd�d	d!�}	|d|	7}q�Wd}
||
7}|S(Nts<data type="%s">
RRRs
open-checksumis  <%s type="%s">%s</%s>
iRs  <location href="%s"/>
s&  <location xml:base="%s" href="%s"/>
RRRRRs	open-sizes  <%s>%s</%s>
s
  s
i����s  <delta>
  %s
  </delta>
s</data>
(schecksumschecksum(sopenchecksums
open-checksum(s	timestamps	timestamp(s	dbversionsdatabase_version(ssizessize(sopensizes	open-size(	RRtTruethasattrtgetattrRtjointdump_xmlR(Rtmsgttoptdatatxmlnametvaltd_xmltlocRtbodytbottom((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyR-OsB



0
%
cCs=t|�}x*|jD]}t|j�|kr|SqWdS(N(tintRR(Rt
old_timestamptdeltamd((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pytgetDeltaxsN(t__name__t
__module__t__doc__R
RRR-R:(((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyRs
	 	)tRepoMDcBsGeZdZdd�Zd�Zd�Zd�Zd�Zd�Z	RS(srepresents the repomd xml filecCstd|_||_i|_i|_d|_d|_it�d6id6t�d6|_|rp|j	|�ndS(s0takes a repoid and a filename for the repomd.xmlitcontenttdistrotrepoN(
RtrepoidtrepoDatat	checksumstlengthR
trevisiontsetttagsR(RRBtsrcfile((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyR�s						$cCs�t|�tjkrOyt|d�}Wq[tk
rKtd|f�q[Xn|}d}t|ddgdtdt�}t	|�}yx�|D]�\}}t
|j�}|dkr�td|�}|j
j|j�}|rq|jrq|j|jkrq|jd	jd
d	�d	tkrq|rqt|jdd	�dd|jd	jdd	�d	�dkrq|}n||j
|j<y.t|j�}	|	|jkr�|	|_nWq|q|Xq�|d
kr�|j|_q�|dkr�x�|D]�}
t
|
j�}|dkr%|jdj|
j�n|dkr�|
jjdd�}|jdj|t��}
|
j|
j�q�q�Wq�q�W|jj�|_t|j�|_ Wnt!k
r�}td�nXdS(NtrtsUnable to open %stsha256tsha512tignore_missingtignore_noneR0Rit.t/iRFRHR?R@tcpeidR(sDamaged repomd.xml file("RttypestStringTypestopentIOErrorRR
RR)t	iterparseR
R RRCRRRtrsplitRRR7RR!RFRHtaddRt
setdefaultRGRDt
hexdigeststlenREtSyntaxError(RRItinfiletparserteventRt	elem_nametthisdatatoldtntsR#R$RQR@te((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyR�sV
!# '	
cCs
|jj�S(s,return list of metadata file types available(RCtkeys(R((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyt	fileTypes�scCs+||jkr|j|Std|�dS(Ns#requested datatype %s not available(RCR(RR((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pytgetData�scCs�d|jGHd|jGHx-t|j�D]}d||j|fGHq(W|jdk	rfd|jGHn|jdr�ddjt|jd��GHn|jdr�xPt|jd�D]8}d	|GH|jd|}d
djt|��GHq�WndGHx�t|j��D]x}|j	|}d|j
GHd
|jGHd|jGHd|jGHd|j
GHd|jGHd|jGHd|jGHdGHq
WdS(sdump fun outputsfile timestamp: %ssfile length   : %ssfile checksum : %s/%ssrevision: %sR?stags content: %ss, R@stags distro: %ss
  tags: %ss
---- Data ----s  datatype: %ss    location     : %s %ss    timestamp    : %ss    size         : %ss    open size    : %ss    checksum     : %s - %ss    open checksum: %s - %ss    dbversion    : %sR(N(RREtsortedRDRFR
RHR,RfRCRRRRRRR(RtcsumR@RHtftRa((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pytdump�s2
"
	
cCs�d}d}||7}|jr?dt|j�}||7}n|jdsf|jdsf|jdr�d}x/|jdD] }dt|�}||7}qzWx/|jdD] }d	t|�}||7}q�W|jd}t|t�r@g}xBt|�D]4}	x+t||	�D]}|j|	|f�qWq�W|}nxY|D]Q\}	}|	r~d
t|	dt�t|�f}ndt|�}||7}qGW|d
7}||7}nx'|jj	�D]}
||
j
�7}q�W|d7}|S(NR(s�<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
s <revision>%s</revision>
R?R@RAs <tags>
s   <content>%s</content>
s   <repo>%s</repo>
s"   <distro cpeid="%s">%s</distro>
Rs   <distro>%s</distro>
s	 </tags>
s
</repomd>
(RFRRHt
isinstancetdictRhR"R)RCtvaluesR-(RR.R/trevRHtitemR R@tlstRQtmd((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyR-�sB
	
'
	"


N(
R;R<R=R
RRRfRgRkR-(((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyR>~s	9			cCsqy4dtjdGHtdtjd�}|j�Wn6tk
rltjdtjdIJtjd�nXdS(Nsfile          : %siRBsnewcomps.py: No such file:'%s'(tsystargvR>RkRUtstderrtexit(tp((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pytmains
t__main__(((tyum.miscRRVRRtErrorsRRsRRtmiscRRR
RR>RxR;(((s4/usr/lib/python2.7/site-packages/yum/repoMDObject.pyt<module>s	a�	

Zerion Mini Shell 1.0