ghfdZdZddlmZddlZddlZddlmZddlm Z ddl m Z m Z m Z mZddlmZmZdd lmZmZmZdd lmZmZdd lmZGd d eZGddeZGddeZGddeZGddeZGddeZGddeZ GddeZ!Gddej"Z#GddeZ$Gd d!eZ%Gd"d#eZ&dS)$zMiscellaneous directives.reStructuredText)PathN)urlopen)URLError)ionodes statemachineutils) Directiveconvert_directive_function) directivesrolesstates) CodeBlock NumberLines)miscc eZdZdZdZdZdZejej ej ej e e e ej ej ej ejej d Zeejjdz ZdZdS) Includea Include content read from a separate source file. Content may be parsed by the parser, or included as a literal block. The encoding of the included file can be specified. Only a part of the given file argument may be included by specifying start and end line or text to match before and/or after the text to be used. https://docutils.sourceforge.io/docs/ref/rst/directives.html#including-an-external-document-fragment rT) literalcodeencodingparser tab-width start-lineend-line start-after end-before number-linesclassnameincludec |jjjjs|d|jz|jjj}tj|j d}| dr'| dr|j }|dd}nt|j}tjd||z }|jd|jjjj}|jjjj}|jd |jjjj} t-j||| }|jjjj|no#t4$r"|d |jd |d t8$r8}|d |jdt-j|dd}~wwxYw|jdd} |jdd} | s| 2|} d| | | } n| } nE#tB$r8}|d|jdt-j|zd}~wwxYw|jdd} | rR| "| }|dkr|d|jz| |tG| zd} |jdd}|rB| "|}|dkr|d|jz| d|} tIj%| |d}tM|D]I\}}tG||jjjj'kr|d||dzfzJd|jvrP|dkr| (|}n| }tSj*| ||jdg}d|_+|,|d|jvr t[|jdpd} n##t\$r|/d wxYw| tG|z} | d!r |dd}tag|fg| | }|D]9\}}|r|tSj1|||"z }"|tSj2|z }:n|tSj2|z }|gSd#|jvr||jd$<|dkr| 3}ti|j|j5d#g|j||j6|j7|j8|j|j9 }|:S| | || f}|jjj;}|s*|<tjd|d%f||f|vrRd&t{|D}d'|g|R}|d(|jd|d)|jvrtj>||jjj}|||fgz|_;|jd)}|?d!|||j@A|f|j@B|jCS|dd*|zgz }|j9D|||<||fgS)+zInclude a file as part of the content of this reST file. Depending on the options, the file (or a clipping) is converted to nodes and returned or inserted into the input stream. "%s" directive disabled.r<>rNrr source_pathr error_handlerProblems with "z1" directive path: Cannot encode input file path "z" (wrong locale?)." directive path: .rrProblem with " " directive: rzDProblem with "start-after" option of "%s" directive: Text not found.rzCProblem with "end-before" option of "%s" directive: Text not found.T)convert_whitespacez,"%s": line %d exceeds the line-length-limit.rr )sourceclassesrz+:number-lines: with non-integer start value )r3rr2)NNNNc3 K|] \}}|V dS)N).0pthopts /builddir/build/BUILD/imunify360-venv-2.6.0/opt/imunify360/venv/lib/python3.11/site-packages/docutils/parsers/rst/directives/misc.py zInclude.run..s&HHJS#CHHHHHHz > zcircular inclusion in "rz.. end of inclusion from "%s")Estatedocumentsettingsfile_insertion_enabledwarningr!current_sourcer path arguments startswithendswithstandard_include_pathrparentr relative_pathoptionsgetinput_encodinginput_encoding_error_handler tab_widthr FileInputrecord_dependenciesaddUnicodeEncodeErrorsevereOSError error_string readlinesjoinread UnicodeErrorfindlenr string2lines enumerateline_length_limit expandtabsr literal_blocklineadd_nameint ValueErrorerrorrinlineText splitlinesrpoplinenocontent_offset block_text state_machinerun include_logappendreversed new_documentparse transformerpopulate_from_componentsapply_transformschildren insert_input) selfrBrC_baser e_handlerrN include_filere startlineendlinelinesrawtext after_text after_index before_text before_index include_linesiratextr`tokensr3value codeblock clip_optionsro master_pathsinclusion_chainr>rs r:rnz Include.run7s z"+B G,,9DIEFF F,;t~a011 ??3   0DMM#$6$6 0.E":DD((/E"4t44<##  +4CEEJ'0M L$$ ,5?AA  G(>BBBCC C CL$$\488 ,"":t44 8 .W0$..00''% '(9":;;&++-- 8 8 8++HtyHHH " 6 6788 8 8 \%%mT::  >!,,z22KQkk#@BF)#LMMMkC OO;<<=Gl&&|T::  -"<< 44Lakk#@BF)#LMMMm|m,G$1'9EIKKK  // H HGAt4yy4:.7IIIll$9<@!A#;$GHHHJ  $ $A~~)))44!/ '(, (8(8"(E(EGGGM"#M  MM- ( ( (--4 #DL$@$EA F FII!444**&34444$c-&8&88==&&%9D$r4j\9gFF&,;;NGU;%eU>E*G*G*GG &E):):: ;D!1!11 !? " T\ ! !%)DL "1}} ' 2 2 4 4 !$)#'<#3#3F#;#;"<"&,"/"&+"&"5"&/"&*"&"466I==?? ""7KD j)5  ;    3D. I I 8 : ; ; ; , ; . .HH(;2G2GHHHL$kk4*?,*?*?@@O,,,"&)))__ >?? ? t| # #)$ 0C0LMMH#.42F1G#GH +T\(+--F LL=118 < < <  9 96) D D D  1 1 3 3 3$ $ "=DEE  '' t<<<D,/000 s=F4G.63G))G.(A I33 J5=3J00J54R R1N)__name__ __module__ __qualname____doc__required_argumentsoptional_argumentsfinal_argument_whitespacer flag unchangedr parser_namercunchanged_required class_option option_specrr__file__rHrGrnr6r<r:rrs   $(o%/)2'3 #!$"","?!+!>#-#7&3%/ 1 1K!D1189DWWWWWr<rc^eZdZdZdZdZdZejej ej ej dZ dZ dZdS)Rawz Pass through content unchanged Content is included in output based on type argument Content may be included inline (content section of directive) or imported from a file or url. rrT)fileurlrr c 0|jjjjr(|jjjjs/d|jvs d|jvr|d|jzdd|j d i}|j d|jjjj }|jjjj}|jrKd|jvs d|jvr|d|jzd |j}nd|jvrWd|jvr|d |jz|jd}t#|jjjj}t)jd||z } t-j||| }|jjjj|nE#t4$r8}|d |jd t-j|dd}~wwxYw |}nE#t<$r8}|d|jdt-j|zd}~wwxYw||d<n!d|jvr|jd} t?| } nZ#t@t4f$rF}|d |jd|jddt-j|dd}~wwxYwt-j!| | ||} |}nE#t<$r8}|d|jdt-j|zd}~wwxYw| |d<n|"tGj$d|fd|j dgi|} |j%&|j'\| _(| _)| gS)Nrrr$format rrzF"%s" directive may not both specify an external file and have content.r4zXThe "file" and "url" options may not be simultaneously specified for the "%s" directive.r(r+r,r-r/r0r2z" directive URL "z": )r2r)rr*r.r3r )*r=r>r? raw_enabledr@rJrAr!rWrDlowersplitrKrLrMcontentrerrBrHr rIrrOrPrQrTrSrUrXrYrr StringInputassert_has_contentrrawrmget_source_and_linerjr2ra) ry attributesrr{rrCrzraw_filerer2raw_textraw_nodes r:rnzRaw.runs #,8 GJ'0G Gt|++--,,9DIEFF F):)@)@)B)B)H)H)J)J K KL <##  +4CEEJ'0M <2 &%%$,)>)>jj(*.)455599T\**DD t| # # $$jj8:>)DEEE<'D,;<<CE&tU4Z88D K!+<==a@FFHH-// + +D C$1$77 C C Cjjj$(DD"/%*@*@*@"BCCC C uz'** *GGs!C66 D2-D--D2N)rrrrrrrr rrrecompilerrnr6r<r:rrJsp $%?&O&O--K!bj!122O     r<rc(eZdZdZdZdZdZdZdZdS)Classz Set a "class" attribute on the directive content or the next element. When applied to the next element, a "pending" element is inserted, and a transform does the work later. rrTcx tj|jd}n:#t$r-|d|jd|jddwxYwg}|jrttj}|j |j|j ||D]}|d || |j natjtj||jd|j}|jj||||S)Nrz#Invalid class attribute value for "z" directive: "".r3)r directive)r rrDrdrer!rrrr=rrkextendrwpendingrClassAttributerlrmr> note_pendingrp)ry class_value node_list containerrrs r:rnz Class.runsU 2$1$.2CDDKK 2 2 2***999dnQ///122 2 2 < & I J # #DL$2E$- / / /! 4 4Y&&{3333   Y/ 0 0 0 0m#%DI>>!!G   ' 4 4W = = =   W % % %s "7AN) rrrrrrrrrnr6r<r:rrvsF  $Kr<rcZeZdZdZejdejjfdzzZ dZ dS)RoleTz(%s)\s*(\(\s*(%s)\s*\)\s*)?$c|j|jks|js|d|jz|jd}|j|}|s!|d|jd|d|d}|d}g}|rtj ||j j |j|j j \}}|M|j j d |ztj|j|j|j }||gzSn tj}t%|d rJd |jd |d t'|}|j |jdd|j|i\} } } } nm#t*j$r[} |j d|jd| dtj|j|j|j }||gzcYd} ~ Sd} ~ wwxYwd| vr t/j|| d<nh#t2$r[} |j d|jd| dtj|j|j|j }||gzcYd} ~ Sd} ~ wwxYwtj||| | }tj|||S)z?Dynamically create and register a custom interpreted text role.z4"%s" directive requires arguments on the first line.r"z-" directive arguments not valid role names: "rrN#Unknown interpreted text role "%s".rrDz&Supplemental directive arguments for "z)" directive not supported (specified by "z" role).)option_presetsrr0r-r zInvalid argument for ")rkrjrrer!argument_patternmatchgrouprrolermlanguager=rrr`rlgeneric_custom_rolehasattrr parse_directive_blockr MarkupErrorr rrd CustomRoleregister_local_role)ryargsr new_role_namebase_role_namer base_rolereconverted_rolerDrJrrkdetailrs r:rnzRole.runsV   , ,DL ,**%'+y122 2|A%++D11 :***(, 4449:: : A Q  2"'* 2 ;T[ ##%#% Ix  +119NJ'II2&& 5')) !1I9k22 L L L59YYY  K L L2 &7 BBN11L$d&9"2277 Y..! & & &M'''37999fffE#DOT_EE[(""Eug% % % % % % %  & ' ! ! *#-#:=#I#I   * * * +++yyy&&&*'II ,&&  5')))))))  * y'7KK !-666s?#AF((H7AH H HH22 J)rys r:rnz Title.runs/3~a/@#G, r<N)rrrrrrrnr6r<r:rrs5 $r<rceZdZdZdZdS)MetaBodyc\||\}}|xj|z c_g|gfS)z Meta element.) parsemetarH)ryrcontext next_stater blank_finishs r: field_markerzMetaBody.field_markers5!^^E22l t :r!!r<c 0||}tjtj|}|j|\}}}}tj}tjtjd ||d<|sA|jj }|j d|ztj ||} | |fS|} tj| dd\} } | || <n #tj$r| d|d<YnwxYw| ddD]} tj| d\} } | || <8#tj$rQ}|jj }|j d| d|d tj ||} | |fcYd}~cSd}~wwxYw||fS) NrrzNo content for meta tag "%s".rr!rz"Error parsing meta tag attribute "z": r-)parse_field_markerrunescaper escape2nullrmget_first_known_indentedendmetarWrarinfor`rextract_name_valuerNameValueErrorre)ryrr!indentedindent line_offsetrrramsgrattnamevaltokenrs r:rzMetaBody.parsemetas@&&u--~e/5566   8 8 E E 6; z||.):,/HHX,>,>*@*@AAY %%*D-$$1D8%dD1133C $ $ % 3F1I>>qALGS$'D ! !# % % %!!9DLLL %ABBZ ) )E )$7>>qA (+W]]__%%' ) ) )).m)))().)first_child_not_matching_classTitularrrw)ryrnew_line_offsetrreindexs r:rnzMeta.run.s !!!}(, (D(D L$-t$4!%)E)0)0% d1 1c$,6G6G G GM'')#DOT_EE[(""E EMD #BB). (CEEJHI +/= E%K( r<N)rrrrrr!rnr6r<r:rr(s4K(-Hr<rceZdZdZdZdS)DateTct|jtjs|d|jzd|jpd}tj |}tj |gS)Nrr4z%Y-%m-%d) rr=rrrer!rWrtimestrftimerrg)ry format_strrs r:rnzDate.runGs|$*f&<== :**-/3y9:: :YYt|,,: "}Z(( 4  !!r<Nrr6r<r:r'r'Cs(K"""""r<r'c6eZdZdZdZdZdejiZdZ dZ dS) TestDirectivez3This directive is useful only for testing purposes.rToptionc \|jrid|j}|jd|jd|jd|jdtj|||j }n:|jd|jd|jd|jd|j }|gS)Nr4zDirective processed. Type="z ", arguments=z , options=z , content:rz, content: None) rrWrrr!rDrJrr`rj)ryrrs r:rnzTestDirective.runjs < "99T\**D=%%%"iiiG#D$//dk&CCDD =%%%#'999dnnndlllL[&""Dv r<N) rrrrrrr rrrrnr6r<r:r-r-asG== $Z:;KK     r<r-)'r __docformat__pathlibrrr)urllib.requestr urllib.errorrdocutilsrrr r docutils.parsers.rstr r r rr$docutils.parsers.rst.directives.bodyrrdocutils.transformsrrrrrrrrrSpecializedBodyrrr'r-r6r<r:r9s  "  """"""!!!!!!333333333333FFFFFFFF::::::::::GGGGGGGG$$$$$$xxxxxixxxvUUUUU)UUUpiB) ) ) ) ) i) ) ) X#####I###L;;;;;9;;;|)4I&"&"&"&"&"v%&"&"&"R96"""""9"""<Ir<