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 :  /proc/21573/root/usr/lib/python2.4/site-packages/yum/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/yum/comps.pyc
m
Pc@s dkZdkZdkTydklZWnej
odkZnXeiZdklZdk	Z	dk
Z
dklZdk
lZdZdZdZd	efd
YZdefdYZd
efdYZdefdYZdZedjoendS(N(t*(scElementTree(sCompsException(s
to_unicode(sget_my_lang_codes*{http://www.w3.org/XML/1998/namespace}langcCs0ti|iot|iSntSdS(N(tBOOLEAN_STATESthas_keytstrngtlowertFalse(R((t-/usr/lib/python2.4/site-packages/yum/comps.pyt
parse_boolean"scCs
t|S(N(tintR(R((Rtparse_number(stCompsObjcBsYtZdZdZedZedZdZdZdZ	dZ
RS(s Group/Category helper object. cCs|iS(s3 Return the "name" of the object for the C locale. N(tselftname(R((Rt__str__/scCs|itS(s9 Return the "name" of the object for the current locale. N(Rt
nameByLangtget_my_lang_code(R((Rtui_name3scCs|itS(s@ Return the "description" of the object for the current locale. N(RtdescriptionByLangR(R((Rtui_description8scCs^|djodSn|i|ijodSn|i|ijodSnt|i|iS(Nii(tothertNoneRt
display_ordertcmpR(RR((Rt__cmp__=s
cCsdk}|g}d|jo|idng}xF|D]>}x5|i|D]$}||jo|i|qSqSWq=W|S(NtC(tgettexttlangt	languagestappendtnelangst_expand_langtnelang(RRRRRR((Rt_expand_languagesHs		

cCsOx?|i|D].}|ii|ot|i|SqqWt|iS(N(RR Rtlangcodettranslated_nameRt
to_unicodeR(RRR!((RRWs
cCsOx?|i|D].}|ii|ot|i|SqqWt|iS(N(RR RR!ttranslated_descriptionRR#tdescription(RRR!((RR_s
(t__name__t
__module__t__doc__R
tpropertyRRRR RR(((RR
+s				tGroupcBsStZdZedZdZeeZdZdZ	dZ
dZRS(s? Group object parsed from group data in each repo. and merged. cCst|_t|_t|_d|_d|_h|_h|_	h|_
h|_h|_h|_
d|_d|_d|_t|_t|_|o|i|ndS(Nti(tTrueRtuser_visibleRtdefaulttselectedRR%R"R$tmandatory_packagestoptional_packagestdefault_packagestconditional_packagesRtlangonlytgroupidRt	installedttoremovetelemtparse(RR8((Rt__init__is$																cCs:|ii|ii|ii|ii}|S(N(RR0tkeysR1R2R3tlst(RR<((Rt_packageiter~s6cCs
x|D]}|idjo0|i}|idj	o
tn||_q|idjoZ|i}|o|i	d}n|i
it}|o||i|<q||_q|idjoe|i}|o|i	d}n|i
it}|o||i|<q|o
||_qq|idjot|i|_q|idjot|i|_q|idjot|i|_q|idd	gjo0|i}|idj	o
tn||_q|id
jo|i|qqWdS(NtidRtutf8R%tuservisibleRR.R4t	lang_onlytpackagelist(R8tchildttagttexttmyidRR5RtCompsExceptiontencodetattribtgett	lang_attrRR"RR$R%RR-R	RR.R4tparse_package_list(RR8RRERCRF((RR9sJ	

	
		

cCsx|D]}|idjo|iid}|p
d}n|d
joqn|i}|djod|i	|<q|djod|i
|<q|djod|i|<q|djo|iid	|i|<qqqWdS(Nt
packagereqttypeu	mandatoryt	mandatoryR.toptionaltconditionalitrequires(ROsdefaultRPRQ(
tpackagelist_elemRCRDRIRJtgenreREtpackageRR0R2R1R3(RRSRTRURC((RRLs"

	



cCsmx|iD]}d|i|<q
Wx|iD]}d|i|<q+Wx|iD]}d|i|<qLWx%|iD]}|i||i|<qmW|idjo |idjo|i|_n|idjo |idjo|i|_nx<|i	D]1}|i	i|p|i	||i	|<qqWx<|iD]1}|ii|p|i||i|<q4q4WdS(s'Add another group object to this objectiR+N(
tobjR0tpkgRR2R1R3RR%R"RRR$(RRVRRW((Rtadds2



  

cCsd|it|iit|ii|if}|io|d|i7}n|d|i	7}x7t
|iiD] \}}|d||f7}qW|d|i7}x7t
|iiD] \}}|d||f7}qW|d7}x%t
|iD]}|d|7}q	Wx%t
|iD]}|d	|7}q1Wx%t
|iD]}|d
|7}qYWx7t
|iiD] \}}|d||f7}qW|d7}|d
7}|S(s,write out an xml stanza for the group objects        
  <group>
   <id>%s</id>
   <default>%s</default>
   <uservisible>%s</uservisible>
   <display_order>%s</display_order>
s   <langonly>%s</langonly>s   <name>%s</name>
s!   <name xml:lang="%s">%s</name>
s!   <description>%s</description>
s/   <description xml:lang="%s">%s</description>
s    <packagelist>
s3      <packagereq type="mandatory">%s</packagereq>
s1      <packagereq type="default">%s</packagereq>
s2      <packagereq type="optional">%s</packagereq>
sC      <packagereq type="conditional" requires="%s">%s</packagereq>
s    </packagelist>
s
  </group>N(RR5tstrR.RR-RtmsgR4RtsortedR"titemsRtvalR%R$R0RWR2R1R3treq(RRR]R^RWRZ((Rtxmls8:



(R&R'R(RR:R=R)tpackagesR9RLRXR_(((RR*fs			3		"tCategorycBsStZdZedZdZeeZdZdZ	dZ
dZRS(sB Category object parsed from group data in each repo. and merged. cCs[d|_d|_d|_h|_h|_d|_h|_|o|i
|ndS(NR+i(RRRt
categoryidR%R"R$Rt_groupsR8R9(RR8((RR:s							cCs
|iiS(N(RRcR;(R((Rt
_groupiter(scCspxi|D]a}|idjo0|i}|idj	o
tn||_q|idjoZ|i}|o|i	d}n|i
it}|o||i|<qh||_q|idjoZ|i}|o|i	d}n|i
it}|o||i|<qh||_q|idjo|i|q|idjot|i|_qqWdS(NR>RR?R%t	grouplistR(R8RCRDRERFRRbRRGRHRIRJRKRR"RR$R%tparse_group_listR	R(RR8RRERCRF((RR9-s6	

	
	
cCs?x8|D]0}|idjo|i}d|i|<qqWdS(NR5i(tgrouplist_elemRCRDRER5RRc(RRgR5RC((RRfQs
	cCsx|iD]}d|i|<q
Wx<|iD]1}|ii|p|i||i|<q+q+Wx<|iD]1}|ii|p|i||i|<qjqjWdS(s*Add another category object to this objectiN(	RVtgroupstgrpRRcR"RRR$(RRVRRi((RRXWs


cCsd|i|if}|d|i7}x1|iiD] \}}|d||f7}q7W|d|i	7}x1|i
iD] \}}|d||f7}q|W|d7}x|iD]}|d|7}qW|d7}|d	7}|S(s/write out an xml stanza for the category objectsJ        
  <category>
   <id>%s</id>
   <display_order>%s</display_order>
s   <name>%s</name>
s!   <name xml:lang="%s">%s</name>
s!   <description>%s</description>
s0    <description xml:lang="%s">%s</description>
s    <grouplist>
s     <groupid>%s</groupid>
s    </grouplist>
s  </category>
N(
RRbRRZRR"R\RR]R%R$RhRi(RRZRRiR]((RR_fs"



(R&R'R(RR:RdR)RhR9RfRXR_(((RRas		$		tCompscBstZedZdZdZdZeeZeeZ	dZ
dZedZe
dZd	Zd
ZddZdZd
ZRS(NcCs1h|_h|_d|_||_t|_dS(Ni(RRct_categoriest
compscounttoverwrite_groupsRtcompiled(RRm((RR:s
				cCsM|i|ijodSn/|i|ijot|i|iSndSdS(s9 This sorts for machines, so is the same in all locales. iiN(titem1Rtitem2RR(RRoRp((Rt__sort_orderscCs#|ii}|i|i|S(N(RRctvaluestgrpstsortt_Comps__sort_order(RRs((Rt
get_groupsscCs#|ii}|i|i|S(N(RRkRrtcatsRtRu(RRw((Rtget_categoriesscCs"|i|}|otSntS(N(Rt
return_groupstgrpidtexistsR,R(RRzR{((Rt	has_groupscCs&|i|}|o|dSndS(s$Return the first group which matchesiN(RRyRzRsR(RRzRs((Rtreturn_groups
c
Csh}x|idD]}|i}|ii|o!|i|}|||i	<qn|otit
i|i}	n%tit
i|dtii}	xh|iD]]}|i|i	g}|i|iix,|D]$}|	|o|||i	<qqWqWqW|iS(s;return all groups which match either by glob or exact matcht,tflagsN(treturnst
group_patterntsplittitemtstripRRcRt	thisgroupR5tcase_sensitivetretcompiletfnmatcht	translatetmatchtIRhtgroupRtnamestextendR"Rr(
RRRRRRRRRR((RRys*

$

c	Csh}x|idD]}|i}|ii|o!|i|}|||i	<qn|ptit
i|i}n%tit
i|dtii}xh|iD]]}|i|i	g}|i|iix,|D]$}||o|||i	<qqWqWqW|iS(s?return all categories which match either by glob or exact matchR~RN(RtpatternRRRRRkRtcatRbtignore_caseRRRRRRt
categoriesRRRR"Rr(	RRRRRRRRR((Rtreturn_categoriess*

$

cCsK|ii|io!|i|i}|i|n||i|i<dS(N(RRcRRR5t	thatgroupRX(RRR((Rt	add_groupscCsK|ii|io!|i|i}|i|n||i|i<dS(N(RRkRtcategoryRbtthatcatRX(RRR((Rtadd_categorysc	Cs|p
tnt|tijot|d}n|}|id7_t	|_
t|}yuxn|D]f\}}|idjot|}|i|n|idjot|}|i|qnqnWWntj
o}tdnX~dS(NtrtiRRscomps file is empty/damaged(tsrcfileRGRNttypestStringTypestopentinfileRRlRRnt	iterparsetparserteventR8RDR*RRRaRRtSyntaxErrorte(	RRRRR8RRRR((RRXs(
	cCsh}	x'|D]\}}}}}d|	|<q
Wx|iD]}
t
|
idjo?t|
_
x|
iD]$}|	i|pt|
_
PqiqiWq:|
ii|
ii|
ii}t|
_
x,|D]$}|	i|ot|
_
PqqWq:Wt|_dS(s4 compile the groups into installed/available groups iiN(tinst_pkg_namest
pkgtuplisttntaRtvtrRRhRtlenR0R,R6tpkgnameRRR1R;R2R3t
check_pkgsRn(RRRRRRRRRRR((RRs,
	
	
)		
cCs|io|iodSnd}x$|iD]}||i7}q1Wx$|iD]}||i7}qXW|d7}|S(s8returns the xml of the comps files in this class, mergedR+sz<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE comps PUBLIC "-//Red Hat, Inc.//DTD Comps info//EN" "comps.dtd">
<comps>
s

</comps>
N(	RRcRkRZRvtgR_Rxtc(RRZRR((RR_,s


(R&R'RR:RuRvRxR)RhRR|R}RyR,RRRRRXRR_(((RRj~s										 cCsytidGHt}x"tidD]}|i|q&Wx3|iD](}|GHx|iD]}d|GHq\WqGWx6|i
D]+}|iGHx|iD]}d|GHqWq}WWn8t
j
o,tidtidIJtidnXdS(Nis  snewcomps.py: No such file:'%s'(tsystargvRjtpRRXRhRR`RWRRRtIOErrortstderrtexit(RRRRRW((RtmainBs*	



t__main__(RRt	constantst	xml.etreetcElementTreetImportErrorRtErrorsRGRRtyum.i18nR#tmiscRRKRR	tobjectR
R*RaRjRR&(RaRR*R#RjRGR	RRRR
RRRRRKR((Rt?s,			
		

		;e	


Anon7 - 2021