Wc/ ddlZddlZddlZddlZddlZddlmZddlmZdZ ifdZ ifdZ ifdZ d Z Gd d ejZGd d ej ZddZdS)N)handler) xmlreaderc^ |jD]\}}|j||}|SN)itemsreplace)sdkeyvalues )/usr/lib64/python3.12/xml/sax/saxutils.py__dict_replacer s5<ggi"" U IIc5 ! Hc |jdd}|jdd}|jdd}|rt||}|S)N&&>><<r rdataentitiess rescapersO <<W %D <<V $D <<V $DxdH- Krc |jdd}|jdd}|rt||}|jddS)Nrrrrrrrrs runescaper"sK << $D << $DxdH- << %%rc i|dddd}t||}d|vr#d|vrd|jddz}|Sd |z}|Sd|z}|S) Nz z z )   "'z"%s"z"z'%s')rr rs r quoteattrr%0s G(F'vFFFH $ !D d{{ $;;DLLh77D KD=D K} Krc8ddl}|jSttjrStt j t jfrSttjrGfdd}|}d|_ nRtj}d|_ j|_ j|_ j|_tj ||ddd S#t$rY(wxYw) Nrc2eZdZjZfdZdS) _gettextwriter.._wrapperc t|Sr)getattr)selfnameouts r __getattr__z,_gettextwriter.._wrapper.__getattr__ZssD))rN)__name__ __module__ __qualname__ __class__r.)r-sr_wrapperr(Xs7 I * * * * * * *rr3cdSrr5rrz _gettextwriter..]strcdS)NTr5r5rrr6z _gettextwriter..bs$rxmlcharrefreplacer T)encodingerrorsnewline write_through)sysstdout isinstanceio TextIOBasecodecs StreamWriterStreamReaderWriter RawIOBasecloseBufferedIOBasewritablewriteseekabletellAttributeError TextIOWrapper)r-r9r=r3buffers` r_gettextwriterrOGs4 { zz#r}}%% #++V-F-FGHH #r||$$ * * * * * * * * *#| ""$&,yy  "llFO((FK   FX#6$(*. 0 00    D s"D DDcfeZdZddZdZddZdZdZd Zd Z d Z d Z d Z dZ dZdZdZdS) XMLGeneratorN iso-8859-1Fctjj|t||}|j|_|j |_ig|_|jd|_ g|_ ||_ ||_ d|_ dS)NF)rContentHandler__init__rOrI_writeflush_flush _ns_contexts_current_context_undeclared_ns_maps _encoding_short_empty_elements_pending_start_element)r+r-r9short_empty_elementss rrVzXMLGenerator.__init__rs}''--S(+ii ii D $ 1 1" 5#% !%9"&+###rc |dr?d|dkr d|dzS|j|d}|r|dz|dzS|dS)Nrz$http://www.w3.org/XML/1998/namespacezxml:r:)r[)r+r,prefixs r_qnamezXMLGenerator._qname~scE 77 6a@@Q''**473Fv|d1g--AwrcT|jr|jdd|_dSdS)NrFr_rW)r+ endElements r_finish_pending_start_elementz*XMLGenerator._finish_pending_start_elements3  & & & KK  */D ' ' ' ' &rcD|jd|jzdS)Nz$ )rWr]r+s r startDocumentzXMLGenerator.startDocuments, ;' ( ( ( (rc(|jdSr)rYrjs r endDocumentzXMLGenerator.endDocuments rc|jj|jj||j|<|jj||fdSr)rZappendr[copyr\r+rcuris rstartPrefixMappingzXMLGenerator.startPrefixMappingsY   !6!6!;!;!=>>%+c"   '' 6666rcN|jd|_|jd=dS)NrT)rZr[r+rcs rendPrefixMappingzXMLGenerator.endPrefixMappings) $ 1 1" 5   b ! ! !rc |j|jd|z|jD](\}}|jd|dt|*|jr d|_dS|jddS)Nr =Tr)rhrWrr%r^r_)r+r,attrsr s r startElementzXMLGenerator.startElements **,, C$J"[[] = =MT5 KKKDDD)E*:*:; < < <  % % %*.D ' ' ' KK    rc~|jr|jdd|_dS|jd|zdSNz/>Fzrfr+r,s rrgzXMLGenerator.endElementsD  & & & KK  */D ' ' ' KK$ ' ' ' 'rc |j|jd|j|z|jD]6\}}|r|jd|d|d"|jd|z8g|_|j D]8\}}|jd|j|dt |:|j r d|_dS|jd dS) Nrz xmlns:z="r#z xmlns="%s"rxryTr)rhrWrdr\rr%r^r_)r+r,qnamerzrcrrr s rstartElementNSzXMLGenerator.startElementNSs **,, C$++d++,,33 1 1KFCv <=== MC/000#% "[[] J JMT5 KKKDKK$5$5$5y7G7GH I I I  % % %*.D ' ' ' KK    rc|jr|jdd|_dS|jd|j|zdSr})r_rWrdr+r,rs r endElementNSzXMLGenerator.endElementNSsN  & & & KK  */D ' ' ' KK$++d"33 4 4 4 4rc|r[|jt|tst||j}|j t |dSdSr)rhr?strr]rWrr+contents r characterszXMLGenerator.characterssS 7  . . 0 0gs++gt~~6 KKw ( ( ( ( 7rc|rP|jt|tst||j}|j |dSdSr)rhr?rr]rWrs rignorableWhitespacez XMLGenerator.ignorableWhitespacesO 7  . . 0 0gs++gt~~6 KK 7rcZ|j|jd|d|ddS)Nz)rhrWr+targetrs rprocessingInstructionz"XMLGenerator.processingInstructions5 **,, 66644401111r)NrRF)F)r/r0r1rVrdrhrkrmrsrvr{rgrrrrrr5rrrQrQps , , , ,"0000(((777 """((($555)))!!!22222rrQceZdZ ddZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdS) XMLFilterBaseNcVtjj|||_dSr)r XMLReaderrV_parentr+parents rrVzXMLFilterBase.__init__s$$$T** rc>|jj|dSr) _err_handlererrorr+ exceptions rrzXMLFilterBase.errors  ****rc>|jj|dSr)r fatalErrorrs rrzXMLFilterBase.fatalErrors $$Y////rc>|jj|dSr)rwarningrs rrzXMLFilterBase.warnings !!),,,,rc>|jj|dSr) _cont_handlersetDocumentLocator)r+locators rrz XMLFilterBase.setDocumentLocators --g6666rc<|jjdSr)rrkrjs rrkzXMLFilterBase.startDocuments ((****rc<|jjdSr)rrmrjs rrmzXMLFilterBase.endDocuments &&((((rc@|jj||dSr)rrsrqs rrsz XMLFilterBase.startPrefixMappings! --fc::::rc>|jj|dSr)rrvrus rrvzXMLFilterBase.endPrefixMappings ++F3333rc@|jj||dSr)rr{)r+r,rzs rr{zXMLFilterBase.startElement ! ''e4444rc>|jj|dSr)rrgr~s rrgzXMLFilterBase.endElements %%d++++rcB|jj|||dSr)rr)r+r,rrzs rrzXMLFilterBase.startElementNSs# ))$u====rc@|jj||dSr)rrrs rrzXMLFilterBase.endElementNSrrc>|jj|dSr)rrrs rrzXMLFilterBase.characterss %%g....rc>|jj|dSr)rr)r+charss rrz!XMLFilterBase.ignorableWhitespaces ..u5555rc@|jj||dSr)rrrs rrz#XMLFilterBase.processingInstructions! 00>>>>rc>|jj|dSr)r skippedEntityr~s rrzXMLFilterBase.skippedEntity s ((....rcB|jj|||dSr) _dtd_handler notationDecl)r+r,publicIdsystemIds rrzXMLFilterBase.notationDecl%s# &&tXx@@@@rcD|jj||||dSr)runparsedEntityDecl)r+r,rrndatas rrz XMLFilterBase.unparsedEntityDecl(s% ,,T8XuMMMMrc<|jj||Sr) _ent_handler resolveEntity)r+rrs rrzXMLFilterBase.resolveEntity-s  ..xBBrc|jj||jj||jj||jj ||jj |dSr)rsetContentHandlersetErrorHandlersetEntityResolver setDTDHandlerparse)r+sources rrzXMLFilterBase.parse2sq &&t,, $$T** &&t,, ""4(( 6""""rc>|jj|dSr)r setLocale)r+locales rrzXMLFilterBase.setLocale9s v&&&&rc:|jj|Sr)r getFeaturer~s rrzXMLFilterBase.getFeature<s||&&t,,rc@|jj||dSr)r setFeature)r+r,states rrzXMLFilterBase.setFeature?s e,,,,rc:|jj|Sr)r getPropertyr~s rrzXMLFilterBase.getPropertyBs||''--rc@|jj||dSr)r setProperty)r+r,r s rrzXMLFilterBase.setPropertyEs   u----rc|jSrrrjs r getParentzXMLFilterBase.getParentJs ||rc||_dSrrrs r setParentzXMLFilterBase.setParentMs  rr)r/r0r1rVrrrrrkrmrsrvr{rgrrrrrrrrrrrrrrrrrr5rrrrs +++000--- 777+++)));;;444555,,,>>>555///666???/// AAANNN CCC ###'''------...... rrc t|tjrtj|}t|trt j |}nt|dr|}t j }t|jdtr|j|n|j|t|dr9t|jtr|j|j|j;|j)|j}tj j#tj j%|}tj j'||}tj j)|r!|j|t+|d}nb|jt,j.j1||t,j2j5|j}|j||S)Nreadrr,rb)r?osPathLikefspathrr InputSourcehasattrrsetCharacterStream setByteStreamr, setSystemIdgetCharacterStream getByteStream getSystemIdpathdirnamenormpathjoinisfileopenurllibrurljoinrequesturlopen)rbasefsysidbasehead sysidfilenames rprepare_input_sourcerRsF&"++&&6"&#&&v.  &&( affQi % %  % %a ( ( (   # # 1f  *QVVS"9"9   qvv & &   "*v/C/C/E/M""$77??277#3#3D#9: Xu5 77>>- ( (   } - -]D)AA   v||33D%@ A A&&v'9'9';rsT ('''''''''''      & & & & .'0'0'0Rp2p2p2p2p27))p2p2fkkkkkI''kk^r