a ZÚß^c0ã@s˜ddlZddlZddlmZgd¢ZGdd„dƒZGdd„dƒZdd „ZGd d „d e ƒZ Gd d „d e ƒZ Gdd„dƒZ [Gdd„dƒZ Gdd„dƒZdS)éN)Ú NodeFilter)Ú DOMBuilderÚDOMEntityResolverÚDOMInputSourcec@sXeZdZdZdZdZdZdZdZdZ dZ dZ dZ dZ dZdZdZdZdZdZdZdZdS)ÚOptionséTFN)Ú__name__Ú __module__Ú __qualname__Ú namespacesÚnamespace_declarationsÚ validationÚexternal_parameter_entitiesÚexternal_general_entitiesZexternal_dtd_subsetÚvalidate_if_schemaÚvalidateÚdatatype_normalizationÚcreate_entity_ref_nodesÚentitiesÚwhitespace_in_element_contentÚcdata_sectionsÚcommentsÚcharset_overrides_xml_encodingÚinfosetÚsupported_mediatypes_onlyÚ errorHandlerÚfilter©rrú*/usr/lib64/python3.9/xml/dom/xmlbuilder.pyr s& rc@seZdZdZdZdZdZdZdZdZ eeee fZ dd„Z dd „Z d d „Z d d „Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdgdgdgdgdgdgd gd!gd"gd#gd"d$gd%gd&gd'gd(gd)gd*gd+gd,gd-gggd.¢d/gd0gd1gd2œZd3d4„Zd5d6„Zd7d8„Zd9d:„Zd;d<„ZdS)=rNrééécCs tƒ|_dS©N)rÚ_options©ÚselfrrrÚ__init__9szDOMBuilder.__init__cCs|jSr"©ÚentityResolverr$rrrÚ_get_entityResolver<szDOMBuilder._get_entityResolvercCs ||_dSr"r')r%r(rrrÚ_set_entityResolver>szDOMBuilder._set_entityResolvercCs|jSr"©rr$rrrÚ_get_errorHandlerAszDOMBuilder._get_errorHandlercCs ||_dSr"r+)r%rrrrÚ_set_errorHandlerCszDOMBuilder._set_errorHandlercCs|jSr"©rr$rrrÚ _get_filterFszDOMBuilder._get_filtercCs ||_dSr"r.)r%rrrrÚ _set_filterHszDOMBuilder._set_filtercCsŠ| |¡rr|rdpd}z|jt|ƒ|f}Wn&tyRtj d|f¡d‚Yq†0|D]\}}t|j||ƒqXntj  dt |ƒ¡‚dS)Nrrzunsupported feature: %rzunknown feature: ) ÚsupportsFeatureÚ _settingsÚ _name_xformÚKeyErrorÚxmlÚdomÚNotSupportedErrÚsetattrr#Ú NotFoundErrÚrepr)r%ÚnameÚstateZsettingsÚvaluerrrÚ setFeatureKs   ÿÿ zDOMBuilder.setFeaturecCst|jt|ƒƒSr")Úhasattrr#r3)r%r;rrrr1YszDOMBuilder.supportsFeaturecCst|ƒ|rdpdf}||jvS)Nrr)r3r2)r%r;r<ÚkeyrrrÚ canSetFeature\szDOMBuilder.canSetFeature©r r©r r©r r©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr©rr) rBrIrJrLrP)rrrOrSrU©rr©r r©r r)rBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrU)rr)rrrVrWrXcCsŒt|ƒ}zt|j|ƒWSty†|dkrn|j}|joh|joh|joh|joh|jpf|j pf|j pf|j pf|j YSt j dt|ƒ¡‚Yn0dS)Nrzfeature %s not known)r3Úgetattrr#ÚAttributeErrorrrrrr rrrrr5r6r9r:)r%r;ZxnameÚoptionsrrrÚ getFeature¢s0 ÿþýÿþýüü zDOMBuilder.getFeaturecCs.|jr|j d|¡}ntƒ d|¡}| |¡Sr")r(Ú resolveEntityrÚparse)r%ÚuriÚinputrrrÚparseURI´szDOMBuilder.parseURIcCsRt |j¡}|j|_|j|_|j}|durF|jrFddl}|j |j¡}|  ||¡S©Nr) Úcopyr#rrÚ byteStreamÚsystemIdÚurllib.requestÚrequestÚurlopenÚ_parse_bytestream)r%r`r[ÚfpÚurllibrrrr^»s zDOMBuilder.parsecCs||jvrtdƒ‚tdƒ‚dS)Nznot a legal actionzHaven't written this yet...)Ú_legal_actionsÚ ValueErrorÚNotImplementedError)r%r`ZcnodeÚactionrrrÚparseWithContextÅs zDOMBuilder.parseWithContextcCs ddl}|jj |¡}| |¡Srb)Zxml.dom.expatbuilderr6Z expatbuilderZ makeBuilderZ parseFile)r%Ústreamr[r5ZbuilderrrrriÊszDOMBuilder._parse_bytestream)rr r r(rrZACTION_REPLACEZACTION_APPEND_AS_CHILDRENZACTION_INSERT_AFTERZACTION_INSERT_BEFORErlr&r)r*r,r-r/r0r>r1rAr2r\rar^rprirrrrr,s–ÿ ÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿ ÿÿÿÇ= rcCs| ¡ dd¡S)Nú-Ú_)ÚlowerÚreplace)r;rrrr3Ðsr3c@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) r)Ú_openerc Cs˜tƒ}||_||_| ¡ |¡|_| |¡|_ddl}ddl }|j   |¡}|\}}} } } } | r”|   d¡s”|  | ¡d} ||| | | | f}|j  |¡|_|S)Nrú/)rÚpublicIdreÚ _get_openerÚopenrdÚ_guess_media_encodingÚencodingÚ posixpathÚ urllib.parser^ÚurlparseÚendswithÚdirnameÚ urlunparseÚbaseURI) r%rxreÚsourcer}rkÚpartsÚschemeÚnetlocÚpathÚparamsÚqueryÚfragmentrrrr]×s  zDOMEntityResolver.resolveEntitycCs0z|jWSty*| ¡|_|jYS0dSr")rvrZÚ_create_openerr$rrrryís   zDOMEntityResolver._get_openercCsddl}|j ¡Srb)rfrgZ build_opener)r%rkrrrrŒôsz DOMEntityResolver._create_openercCsF|j ¡}d|vrB| ¡D]&}| d¡r| dd¡d ¡SqdS)Nz Content-Typezcharset=ú=r)rdÚinfoZgetplistÚ startswithÚsplitrt)r%r„rŽZparamrrrr{øs    z'DOMEntityResolver._guess_media_encodingN)rr r Ú __slots__r]ryrŒr{rrrrrÔs rc@sˆeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zd S)!r©rdÚcharacterStreamÚ stringDatar|rxrerƒcCs.d|_d|_d|_d|_d|_d|_d|_dSr"r’r$rrrr&szDOMInputSource.__init__cCs|jSr"©rdr$rrrÚ_get_byteStream szDOMInputSource._get_byteStreamcCs ||_dSr"r•)r%rdrrrÚ_set_byteStreamszDOMInputSource._set_byteStreamcCs|jSr"©r“r$rrrÚ_get_characterStreamsz#DOMInputSource._get_characterStreamcCs ||_dSr"r˜)r%r“rrrÚ_set_characterStreamsz#DOMInputSource._set_characterStreamcCs|jSr"©r”r$rrrÚ_get_stringDataszDOMInputSource._get_stringDatacCs ||_dSr"r›)r%ÚdatarrrÚ_set_stringDataszDOMInputSource._set_stringDatacCs|jSr"©r|r$rrrÚ _get_encodingszDOMInputSource._get_encodingcCs ||_dSr"rŸ)r%r|rrrÚ _set_encodingszDOMInputSource._set_encodingcCs|jSr"©rxr$rrrÚ _get_publicId!szDOMInputSource._get_publicIdcCs ||_dSr"r¢)r%rxrrrÚ _set_publicId#szDOMInputSource._set_publicIdcCs|jSr"©rer$rrrÚ _get_systemId&szDOMInputSource._get_systemIdcCs ||_dSr"r¥)r%rerrrÚ _set_systemId(szDOMInputSource._set_systemIdcCs|jSr"©rƒr$rrrÚ _get_baseURI+szDOMInputSource._get_baseURIcCs ||_dSr"r¨©r%r_rrrÚ _set_baseURI-szDOMInputSource._set_baseURIN)rr r r‘r&r–r—r™ršrœržr r¡r£r¤r¦r§r©r«rrrrrs  rc@s:eZdZdZdZdZdZejZ dd„Z dd„Z d d „Z d S) ÚDOMBuilderFilterrrr r!cCs|jSr")Ú whatToShowr$rrrÚ_get_whatToShowBsz DOMBuilderFilter._get_whatToShowcCs|jSr"©Ú FILTER_ACCEPT©r%ÚelementrrrÚ acceptNodeEszDOMBuilderFilter.acceptNodecCs|jSr"r¯r±rrrÚstartContainerHszDOMBuilderFilter.startContainerN) rr r r°Z FILTER_REJECTZ FILTER_SKIPZFILTER_INTERRUPTrZSHOW_ALLr­r®r³r´rrrrr¬1s r¬c@s@eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dS)Ú DocumentLSFcCsdS)NFrr$rrrÚ _get_asyncSszDocumentLS._get_asynccCs|rtj d¡‚dS)Nz.asynchronous document loading is not supported)r5r6r7)r%ÚflagrrrÚ _set_asyncVsÿzDocumentLS._set_asynccCs tdƒ‚dS)Nz'haven't figured out what this means yet©rnr$rrrÚabort[sÿzDocumentLS.abortcCs tdƒ‚dS©Nzhaven't written this yetr¹rªrrrÚloadaszDocumentLS.loadcCs tdƒ‚dSr»r¹)r%r„rrrÚloadXMLdszDocumentLS.loadXMLcCs*|dur|}n|j|ur"tj ¡‚| ¡Sr")Z ownerDocumentr5r6ZWrongDocumentErrZtoxml)r%ZsnoderrrÚsaveXMLgs   zDocumentLS.saveXMLN) rr r Zasync_r¶r¸rºr¼r½r¾rrrrrµNsrµc@s,eZdZdZdZdd„Zdd„Zdd„Zd S) ÚDOMImplementationLSrrcCsF|durtj d¡‚||jkr$tƒS||jkr:tj d¡‚tdƒ‚dS)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)r5r6r7ÚMODE_SYNCHRONOUSrÚMODE_ASYNCHRONOUSrm)r%ÚmodeZ schemaTyperrrÚcreateDOMBuilderssÿ  ÿz$DOMImplementationLS.createDOMBuildercCs tdƒ‚dS)Nz-the writer interface hasn't been written yet!r¹r$rrrÚcreateDOMWriter~sÿz#DOMImplementationLS.createDOMWritercCstƒSr")rr$rrrÚcreateDOMInputSource‚sz(DOMImplementationLS.createDOMInputSourceN)rr r rÀrÁrÃrÄrÅrrrrr¿os  r¿)rcZxml.domr5Zxml.dom.NodeFilterrÚ__all__rrr3Úobjectrrr¬rµr¿rrrrÚs  %,1!