• File: parsehelper.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyc
  • Date Modified: 03/28/2024 3:28 PM
  • File size: 6.53 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

fc@snddlmZddlmZmZddlZddlZdefdYZdefdYZ	dS(i(tReflectionHelper(tparamstreportNtParseHelpercBseZdZedZedZedZedZedZedZ	egdZ
edZegd	Zegd
Z
egdZRS(sProvides parsing capabilitiescCstjtjdt|r:t|dr:|j}nt|jj}t	j	}|j
d|j|dd|j|dd|j
S(s0Parse entity to corresponding XML representations)redhat_support_lib.infrastructure.brokerst
superclasss8<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
itname_t
namespacedef_s,xmlns:tns="http://www.redhat.com/gss/strata"(RtisModuleMembertsystmodulesttypethasattrRt__name__tlowertStringIOtwritetexporttgetXmlTypeInstancetgetvalue(tselftentityt	type_nametoutput((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyttoXmls

cCs^|j}xKtjjD]:\}}|jj|ksO|j|kr|jSqW|S(N(R
Rt
_rootClassMaptitemsR(RRttntktv((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pytgetXmlWrapperType*s
'cCsI|j}x6tjjD]%\}}|jj|kr|SqW|S(N(R
RRRR(RRRRR((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyR2s
cCsv|rr|dkrr|j}tjj}xB|D]7\}}|jj|ksg|j|kr4|Sq4WndS(Nt(R
RRRRtNone(RRRRRR((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyt
getXmlType:s'cCs7|j|}|jdr3|dt|d!S|S(Ntsii(Rtendswithtlen(RRtinstance((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pytgetSingularXmlTypeInstanceDscCs
||S(s1Encapsulates the entity with the broker instance.((RtfromItemttoType((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyR'KscCs4g}x'|D]}|j|j||q
W|S(sUEncapsulates the entities collection with the broker 
           instance collection.(tappendR'(RR't	fromItemstnew_colltitem((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyttoCollectionPs
cCs
|||S(s5Encapsulates the sub-entity with the broker instance.((RR&R'tparent((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyt	toSubTypeYscCs7|dk	r/t|dkr/|||dSddS(sTEncapsulates the sub-entity collection element with the broker 
           instance.iN(RR#(RR'R-R)((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyttoSubTypeFromCollection^scCs4|dk	r,t|dkr,||dSddS(sPEncapsulates the entity collection element with the broker 
           instance.iN(RR#(RR'R)((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyttoTypeFromCollectiongscCs7g}x*|D]"}|j|j|||q
W|S(sYEncapsulates the sub-entities collection with the broker instance 
           collection.(R(R.(RR'R-R)R*R&((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyttoSubCollectionqs
 (Rt
__module__t__doc__tclassmethodRRRR R%R'R,R.R/R0R1(((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyRs 
	tReportParseHelpercBsDeZedZedZedZedZRS(c
Cstjtjdt|r:t|dr:|j}nt|jj}t	j	}|j
d|j|dd|j|dddd	|j
S(
s0Parse entity to corresponding XML representations)redhat_support_lib.infrastructure.brokersRs8<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
iRt
namespace_RRs(xmlns="http://www.redhat.com/gss/strata"(RRRR	R
RRRR
RRRRR(RRRR((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyR}s

	cCs^|j}xKtjjD]:\}}|jj|ksO|j|kr|jSqW|S(N(R
RRRR(RRRRR((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyRs
'cCsI|j}x6tjjD]%\}}|jj|kr|SqW|S(N(R
RRRR(RRRRR((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyRs
cCsv|rr|dkrr|j}tjj}xB|D]7\}}|jj|ksg|j|kr4|Sq4WndS(NR(R
RRRRR(RRRRRR((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyR s'(RR2R4RRRR (((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyR5{s(
t)redhat_support_lib.utils.reflectionhelperRtredhat_support_lib.xmlRRRRtobjectRR5(((sH/usr/lib/python2.7/site-packages/redhat_support_lib/utils/parsehelper.pyt<module>s
d