mò hã¸Ec@sdZdZdkZdkZdkZdkZdklZlZl Z dkl Z l Z dk l Z lZdk lZlZlZde fd„ƒYZd e fd „ƒYZd e fd „ƒYZd e fd„ƒYZdeifd„ƒYZdZdd„ZdS(sø 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. treStructuredTextN(snodessutilss languages(sApplicationErrors DataError(s TransformsTransformError(spartss referencessmisctHeaderscBsYtZdZdZdZdZeideiƒdfeidƒdffZ d„Z RS(s< Process fields in a PEP's initial RFC-2822 header. ihs pep-%04d.htmlsVhttp://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/nondist/peps/pep-%04d.txts\$RCSfile: (.+),v \$$s\1s\$[a-zA-Z]+: (.+) \$$c Cs’t|iƒptdƒ‚n|id}t|tiƒ pd|djotdƒ‚nd}x4|D],} | di ƒi ƒdjo | di ƒ}yt|ƒ}|i|} WnÔtj oÈ|}d} |iiid|d | ƒ} |ii| ƒ}ti||pd d |ƒ}|ii|ƒ}| i|ƒt| dƒo|g| dd(q–| dctid d |ƒ7tlentselftdocumentt DataErrortheadert isinstancetnodest field_listtNoneRtfieldtastexttlowertvaluetintt pep_cvs_urltcvs_urlt ValueErrortreportertwarningtmsgtset_idtmsgidt problematictprbtprbidt add_backreft paragraphtpendingtPEPZerotinsertt note_pendingtnametbodytpformatttimetstrftimet localtimetoststattdatet referencetparatnodet replace_selft mask_emailtnewbodytTexttspacetretsplittrefpeptpepnotappendtsettingst pep_base_urltpep_urltutilstclean_rcs_keywordstrcs_keyword_substitutionstpep_typeturi(RR;R(R)RRDR>R&RR RR$R1R:R8RLR0R@RMRRCR,((t7/data/zmath/zope/lib/python/docutils/transforms/peps.pytapply+s¤ %    $   4  $  &3   "  !  $   ( t__name__t __module__t__doc__tdefault_priorityRHRRAtcompilet IGNORECASERKRO(((RNRs 0tContentscBstZdZdZd„ZRS(s~ Insert an empty table of contents topic and a transform placeholder into the document after the RFC 2822 header. i|cCsÜti|iiiƒ}|id}t i d|ƒ}t i d|ddgƒ}t i |ƒ}|ii |ƒp|di|ƒn|ii|ƒt itiƒ}||7}|iid|ƒ|ii|ƒdS(NtcontentsRRtnamesi(t languagest get_languageRRRFt language_codetlanguagetlabelsR0RRttopictfully_normalize_namethas_nameREtnote_implicit_targetR,tpartsRVR.R/(RR^R0R\RR,((RNRO”s  (RPRQRRRSRO(((RNRV‹s t TargetNotescBs&tZdZdZd„Zd„ZRS(s¶ Locate the "References" section, insert a placeholder for an external target footnote insertion transform at the end, and schedule the transform to run immediately. icCsˆ|i}t|ƒd}d}}x†|djoxt||t i ƒoa||di ƒi ƒi ƒ}d|jo||}Pnd|jo |}n|d8}q&W|p[t i ƒ}|t iddƒ7}|i|ƒ|o|i||ƒq|i|ƒnt itiƒ}|i|ƒ|ii|dƒt itidhd|i<ƒ}|i|ƒ|ii|dƒdS( Niit referencest copyrightRt Referencestdetailstcallback(RRtdocRtiRtrefsectReRRtsectionRRRBt title_wordsRR%R.RER,RdRcR/tmisctCallBacktcleanup_callback(RReRjRiRkR,Rm((RNRO­s4  $          cCs4t|iƒdjo|iii|iƒndS(s Remove an empty "References" section. Called after the `references.TargetNotes` transform is complete. iN(RR,tparenttremove(RR,((RNRpËs(RPRQRRRSRORp(((RNRc£s  R-cBstZdZdZd„ZRS(s' Special processing for PEP 0. iøcCs9t|iƒ}|ii|ƒ|iii|iƒdS(N(tPEPZeroSpecialRRtvisitortwalkt startnodeRqRr(RRt((RNROÝs(RPRQRRRSRO(((RNR-Õs RscBsVtZdZeiZd„Zd„Zd„Zd„Zd„Z d„Z d„Z RS(s´ Perform the special processing needed by PEP 0: - Mask email addresses. - Link PEP numbers in the second column of 4-column tables to the PEPs themselves. cCsdS(N((RR;((RNt unknown_visitðscCs|it|ƒƒdS(N(R;R<R=(RR;((RNtvisit_referenceóscCs"d|djo ti‚ndS(NRR(R;RtSkipNode(RR;((RNtvisit_field_listöscCs |ddj|_d|_dS(Ntcolsii(R;Rt pep_tabletentry(RR;((RNt visit_tgroupúscCsB|id7_|io%|idjo|didƒndS(NiiRtnum(RR}R|R;RE(RR;((RNt visit_colspecþscCs d|_dS(Ni(RR}(RR;((RNt visit_rowscCsñ|id7_|ioÔ|idjoÄt|ƒdjo±|didƒ|d}t|ti ƒot|ƒdjol|i ƒ}yFt |ƒ}|iii|i|}ti||d|ƒ|d