jfkdZdZddlmZddlZddlZddlmZmZm Z m Z Gddej Z Gdd e j Z Gd d ejZGd d ejjjZdS)zv Simple document tree Writer, writes Docutils XML according to https://docutils.sourceforge.io/docs/ref/docutils.dtd. reStructuredText)StringION)frontendnodeswritersutilsceZdZdS) RawXmlErrorN)__name__ __module__ __qualname__}/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/docutils/writers/docutils_xml.pyr r sDrr c eZdZdZ ddddgdejdfdd gdejdfd d gd d dejdfddgdd dejdfffZddiZdZdZ dZ dZ dZ dS)Writer)xmlz"Docutils XML" Writer OptionsNz1Generate XML with newlines before and after tags.z --newlines store_true)action validatorz'Generate XML with indents and newlines.z --indentsz,Omit the XML declaration. Use with caution.z--no-xml-declarationxml_declaration store_false)destdefaultrrzOmit the DOCTYPE declaration.z --no-doctypedoctype_declarationoutput_encoding_error_handlerxmlcharrefreplacezdocutils_xml writer)rc\tj|t|_dSN)rr__init__ XMLTranslatortranslator_class)selfs rr!zWriter.__init__7s&%%% -rc||jx|_}|j|d|j|_dS)N)r#documentvisitor walkaboutjoinoutput)r$r(s r translatezWriter.translate;sM!%!6!6t}!E!EE w (((gggn-- r) r r r supportedrvalidate_boolean settings_specsettings_defaultsconfig_sectionconfig_section_dependenciesr+r!r,rrrrrsI' ( = .!0I J J L 4 -!0I J J L 9 ! "$m 1 3 3 4 *  (Q"1J L L M OPM$9:MN*N". F.........rrceZdZdZdZejZ e dddZ e j e j e je jfZdZdZdZd Zd Zd S) r"z z" z5http://xml.org/sax/features/external-general-entitiesTctj|||jjj|_|jjj|_|jx|_}dx|_ |_ |j rd|_ |j rd|_ d|_ d|_ d|_d|_g|_|jr1|jt'j|j|jr|j|j|j|jt0jzt5|_|j|jdS)Nr& z r)r NodeVisitorr!r'reporterwarningwarnerrorsettingsindentnewlinenewlinesindentslevel in_simple fixed_textr+rappendroutput_encodingrdoctype generatordocutils __version__TestXml the_handle xmlparsersetContentHandler)r$r'r;s rr!zXMLTranslator.__init__PsA ""4222M*2 ]+1 $,#44 %'' dl   DL   !DL DK   # P K  u4X5MNN O O O  ' - K  t| , , , 4>H,@@AAA")) ((99999rc |js'|j|j|jz|j|t jjj |xjdz c_t|tj tj fr|xjdz c_t||jr|xjdz c_|js!|j|jdSdS)zDefault node visit method.rN)rAr+rCr<r@starttagrsaxsaxutils quoteattr isinstancerFixedTextElementliteralrB simple_nodesr=r$nodes r default_visitzXMLTranslator.default_visitus~ 7 K  t{4:5 6 6 6 4==)9)CDDEEE a dU3U]C D D ! OOq OO dD- . . NNa NN~ - K  t| , , , , , - -rc|xjdzc_|js'|j|j|jz|j|t |tjtj fr|xj dzc_ t ||j r|xjdzc_|js!|j|j dSdS)zDefault node depart method.rN) r@rAr+rCr<endtagrRrrSrTrBrUr=rVs rdefault_departurezXMLTranslator.default_departures a ~ 7 K  t{4:5 6 6 6 4;;==))) dU3U]C D D ! OOq OO dD- . . NNa NN~ - K  t| , , , , , - -rctjj|}|js&|dd|j|jzz}|j |dS)Nr5) rrOrPescapeastextrBreplacer<r@r+rC)r$rWtexts r visit_TextzXMLTranslator.visit_Textsjw&&t{{}}55 C<<d4;tz+A&ABBD 4     rcdSr rrVs r depart_TextzXMLTranslator.depart_Texts rc$d|ddvr||dS|||}|j||| |jt|n#tj j j $r|jj}|jj}|j}t'|jt*js|dz }d|||fz}|||j||zdz YnwxYwt*j)Nrformatr&z0Invalid raw XML in column %d, line offset %d: %sr)sourceline)getsplitrXr^r+rCr[rKparserrrO _exceptionsSAXParseExceptionrJlocatorgetColumnNumber getLineNumberrhrRparentr TextElementr9rgSkipNode)r$rW xml_stringcol_numline_numsrclinemsgs r visit_rawzXMLTranslator.visit_raws 2..4466 6 6   t $ $ $ F 4   [[]]  :&&& t$$$ H N *!5!5 6 6 6 6w"4 H H Ho-==??G.<<>>HiGdk5+<== 1 EHdkkmmI55C IIc$+GH4DQ4FI G G G G G Hns'CB=FFN)r r r rErFrrO make_parserrK setFeaturer!rrrimagecolspec transitionrUrXr[rarcryrrrr"r"As  F 6I##%%I7 ?GGG:::D%K0@BL - - - - - - !!!   rr"ceZdZdZdS)rIc||_dSr )rn)r$rns rsetDocumentLocatorzTestXml.setDocumentLocators  rN)r r r rrrrrIrIs#rrI)__doc__ __docformat__iorxml.sax.saxutilsrrGrrrrApplicationErrorr rGenericNodeVisitorr"rOhandlerContentHandlerrIrrrrs,  # 444444444444     (+   &.&.&.&.&.W^&.&.&.RsssssE,ssslcgo,r