jfg+dZdZddlZddlZddlZddlmZmZmZddlm Z ddl m Z ddl m Z m Z mZGdd e ZGd d e ZGd d e ZGdde ZGddejZdZddZdS)z Transforms for PEP processing. - `Headers`: Used to transform a PEP's initial RFC-2822 header. It remains a field list, but some entries get processed. - `Contents`: Auto-inserts a table of contents. - `PEPZero`: Special processing for PEP 0. reStructuredTextN)nodesutils languages) DataError) Transform)parts referencesmisccxeZdZdZdZdZdZejdej dfejddffZ dZ d S) Headersz< Process fields in a PEP's initial RFC-2822 header. ihzpep-%04dz3http://hg.python.org/peps/file/default/pep-%04d.txtz\$RCSfile: (.+),v \$$z\1z\$[a-zA-Z]+: (.+) \$$c $ t|jstd|jd}t|tjr d|dvrtdd}|D]S}|ddkr|d} t|}|j |z}n#t$r|}d}|jj d|z| }|j |}t j||pd | }|j |} || t|dr|g|dddd<n$|dxxt jd d |z cc<YnwxYwnU|td |dkrNt jt$} |jd| |j| t|dks6|dddkrtd|D]}|d} |d} t| dkr&td|dzt| dkrGt| dtjs&td|dzn| dkr t-jdt-jt3j|jdd} n#t6$rd} YnwxYw|r.| t jd d t jd | |z } na| d}| dkrC|D]>}t|tjr"|t=|?| dkrD|D]?}t|tjr#|t=||@| dvrg}t jd}tAj!d| D]j}t|}|"t j|||jj#j$|j%|zz|"|k|dd|dd<| dkrOtMj'||j(|r1|} t jd | |g|dd<| d krO|}|jj#j$|j%d!zz}t jd ||g|dd<c| d"kr)t| rtMj'||j(dS)#NzDocument tree is empty.rrfc2822classeszADocument does not begin with an RFC-2822 header; it is not a PEP.pepz?"PEP" header must contain an integer; "%s" is an invalid value.) base_nodez(none))refidz3Document does not contain an RFC-2822 "PEP" header.titlez No title!z4PEP header field body contains multiple elements: %s)levelz=PEP header field body may only contain a single paragraph: %sz last-modifiedz%d-%b-%Ysourceunknownrefuriauthorzdiscussions-to)replacesz replaced-byrequires z,?\s+z content-type version))lendocumentr isinstancer field_listastextlowerint pep_cvs_url ValueErrorreporterwarningset_id problematic add_backref paragraphpendingPEPZeroinsert note_pendingpformattimestrftime localtimeosstatOSError reference replace_self mask_emailTextresplitappendsettings pep_base_urlpep_urlrclean_rcs_keywordsrcs_keyword_substitutions)selfheaderrfieldvaluecvs_urlmsgmsgidprbprbidr4namebodydateparanodenewbodyspacerefpeppepnopep_typeuris x/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/docutils/transforms/peps.pyapplyz Headers.apply(s4=!! 7566 6q!65#344 8y 111788 8  EQx  &&((E11a))Ae**C".4GG!AAAC"G-088)+./:?9AAC!M0055E+E53DH27999C M0055EOOE***58}}A*-a AAAaEOBC$@$@@A)2* ;&'' ' !88mG,,G M G , , , M & &w / / / v;;??fQil113399;;wFFK(( (6 O6 OE8??$$**,,D8D4yy1}}!027--a-2H2H!IJJJTa!$q'5?;;>#%>&+mm!m&<&<%=>>>>((%="rwt}X/F'G'G'JKKMMDD%%%$DDD%KEOBD I I IKKKD7Dx < *djAoo O " "5 ) ) ) ) ) * *ooricd|_dS)Nr)rrs r_ visit_rowzPEPZeroSpecial.visit_rows  ric|xjdz c_|jr|jdkrt|dkr|dd|d}t |t jrt|dkru|} t|}|j j j |j |zz}t j ||||d<dS#t$rYdSwxYwdSdSdSdSdS)Nrrrrrr)rrr%rEr'rr3r)r+r&rFrGrHr?r-)rKrXptextrrefs r_ visit_entryzPEPZeroSpecial.visit_entrys a > djAoo#d))q.. O " "5 ) ) )QA!U_-- #a&&A++xxzzd))C=1>!\C/0C ?4cBBBAaDDD!DD  oo..  ++sAC"" C0/C0N) rarbrcrdr rHrrrrrrrrhrir_rrsoG   ,,,!!!***      rir)zpeps@python.orgzpython-list@python.orgzpython-dev@python.orgcf|dr|ddr|dddtvr |d}n?|dd}t jd|d }||S|dxxd |zz cc<|g|dd<|S|S) a Mask the email address in `ref` and return a replacement node. `ref` is returned unchanged if it contains no email address. For email addresses such as "user@host", mask the address as "user at host" (text) to thwart simple email address harvesters (except for those listed in `non_masked_addresses`). If a PEP number (`pepno`) is given, return a reference including a default email subject. rzmailto:rNr@z at rhtml)formatz?subject=PEP%%20%s)hasattr startswithnon_masked_addressesr)replacerraw)rr\ replacementreplacement_texts r_rArAs {{8 X!9!9)!D!D  x=  4 4 4a&KK"zz||33C9KLL )B(8HHHK =  MMM1E9 9MMM!]CFJ rir)rd __docformat__r<rCr9docutilsrrrrdocutils.transformsrr r r r rkryr5SparseNodeVisitorrrrArhrir_rs # ,,,,,,,,,,))))))7777777777oOoOoOoOoOioOoOoOd,,,,,y,,,2/9/9/9/9/9)/9/9/9d 5 5 5 5 5i 5 5 500000U,000f1 ri