mò #á¸Ec@s7dZdkZd„Zddd„Zdd„ZdS(s; Pretty-Print an Interface object as structured text (Yum) NcCsß|iƒ}|iddƒ}|idƒ}|dg}t|ƒdjo…d}xR|dD]F}t|ƒt|i ƒƒ}||jp |djo |}q^q^Wx'|dD]}|i ||ƒq³Wndi |ƒS(sR Trims a doc string to make it format correctly with structured text. s s iiN(ttexttstriptreplacetsplittlinestnlinestlentNonet min_indenttlinetlstriptindenttappendtjoin(RR RRR R((t//data/zmath/zope/lib/python/Interface/pprint.pyttrim_doc_strings     iiHcCsg}|o£d|}ti|tiddƒƒii ƒ}x^|D]I}di ||gƒ}t |ƒ|jo|i|ƒd|}qEqEW|i|ƒdi |ƒSnO|iddƒi dƒ}x#|D]}|id||ƒqÒWdi |ƒSdS(s9 indent and justify text, rejustify (munge) if specified t s s ts N(RtmungetlevelR tstringt translateRt maketransRRtwordR RtwidthR R(RRRRRRR ((Rtjustify_and_indents$ '  cCshd|iƒ}d}|iƒo'|tt|iƒƒ|ƒd}n|iƒoq|d|d}|d}xD|iƒD]6}d|iƒ}|tt|ƒ||ƒd}q€W|d}n|d}x|i ƒD]\}}t|dƒo)d|iƒ|iƒ|iƒf}nd |iƒ|iƒf}|tt|ƒ||ƒd}qßW|S( si Output structured text format. Note, this will wack any existing 'structured' format of the text. s%s is RsThis interface extends: so %stgetSignatureReprs %s%s -- %ss%s -- %sN(tItgetNametoutpRtgetDocRRtgetBasestbtitemRtnamesAndDescriptionstnametdescthasattrR(RRRR R#RR!R$((Rtinterface_as_stx6s* '   $  )$(t__doc__RRRR&(R&RRR((Rt?s