e6dZddlZddgZd dZd dZdZd dZy) z Pretty-Print an Interface object as structured text (Yum) This module provides a function, asStructuredText, for rendering an interface as structured text. NasReStructuredTextasStructuredTextc|rd}nd}||jg}|j}d}|jr)|tt |j||j Dcgc] }|t jjur|"}}|rY|td|||dz }|D]7} d|| jz} |tt | ||9|dz}t|j} |td|||dz }| D]f\} } t| drdj|| j| jxsd } |tt | ||h|dz}|td |||dz }| D]\} } t| dsd j| j| j}dj||| jxsd } |tt | ||d j|d zScc}w) z Output structured text format. Note, this will whack any existing 'structured' format of the text. If `rst=True`, then the output will quote all code as inline literals in accordance with 'reStructuredText' markup principles. c$dj|S)Nz``{}``)formatss 9/usr/lib/python3/dist-packages/zope/interface/document.pyz"asStructuredText..#s8??1#5c|S)Nrs r r z"asStructuredText..%s1r zThis interface extends:zo %sz Attributes:getSignatureStringz{} -- {}zno documentationzMethods:z{}{}z )getNameappendgetDoc_justify_and_indent_trim_doc_string __bases__zope interface InterfacesortednamesAndDescriptionshasattrrrjoin)Imungerstinline_literalroutplevelbasebasesbitemrnamedesc_calls r rrsI 5$  $%A 88D Exxz !1!((*!=u EF DNN444 E   !:E5 IJ   LAN199;77D $%5d%;UEJ K L  !!"8"8":; ]E5 9: QJE*L dt12$$^DLLN%C!%!D2DFD $%5d%;UEJ K L  QJE Z 67 QJE*L d 4- .MM$,,.$2I2I2KLE$$^E%:!%!D2DFD $%5d%;UEJ K L ;;q>F ""A s6%Ict||dS)zi Output reStructuredText format. Note, this will whack any existing 'structured' format of the text.T)rr )r)rrs r rrQs AU 55r c F|jddjd}|jdg}|rWt|Dcgc]'}t |t |j z )c}}|D]}|j ||ddj|Scc}w)zJ Trims a doc string to make it format correctly with structured text.   rN)replacesplitpopminlenlstriprr)textlinesnlinesline min_indents r rrWs LL & , ,T 2Eiil^F &+-"d)c$++-&88-.  -D MM$z{+ , - 99V  -s,Bc`d|z}|rrg}|}|j}|D]7}dj||g}t||kDs%|j||}9|j|dj|S||j j ddj dd|zzS)z9 indent and justify text, rejustify (munge) if specified  r/r.)r1rr4rstripr0)r6r$rwidthindentr7r9words r rrfs5[F zz| D88T4L)D4y5  T"   LL yy JJL  . 7 7dVm LM Mr )rF)r)rH)__doc__zope.interfacer__all__rrrrrr r rEs4   4#n6 Mr