ó úŠ/Qc@s:dZddlZdd„Zd„Zddd„ZdS(sž Pretty-Print an Interface object as structured text (Yum) This module provides a function, asStructuredText, for rendering an interface as structured text. iÿÿÿÿNic Cs.|jƒg}|j}d}|jƒrL|tt|jƒƒ|ƒƒng|jD]}|tjjk rV|^qV}|rê|td||ƒƒ|d7}x:|D]2}d|jƒ}|tt|ƒ||ƒƒq§W|d8}nt |j ƒƒ} |td||ƒƒ|d7}xd| D]\\} } t | dƒs#d| jƒ| jƒpYdf}|tt|ƒ||ƒƒq#q#W|d8}|td||ƒƒ|d7}xm| D]e\} } t | dƒr´d | jƒ| j ƒ| jƒpódf}|tt|ƒ||ƒƒq´q´Wd j |ƒd S( sj Output structured text format. Note, this will whack any existing 'structured' format of the text. isThis interface extends:so %ss Attributes:tgetSignatureStrings%s -- %ssno documentationsMethods:s %s%s -- %ss (tgetNametappendtgetDoct_justify_and_indentt_trim_doc_stringt __bases__tzopet interfacet InterfacetsortedtnamesAndDescriptionsthasattrRtjoin( tItmungetrtoutptleveltbasetbasestbtitemR tnametdesc((s;/usr/lib/python2.7/dist-packages/zope/interface/document.pytasStructuredTextsB  "       #    #cCsš|jddƒjdƒ}|jdƒg}|rtg|D]"}t|ƒt|jƒƒ^q=ƒ}x"|D]}|j||ƒqoWndj|ƒS(sJ Trims a doc string to make it format correctly with structured text. s s i(treplacetsplittpoptmintlentlstripRR (ttexttlinestnlinestlinet min_indent((s;/usr/lib/python2.7/dist-packages/zope/interface/document.pyRCs/ iHcCs¾d|}|rg}|}|jƒ}xX|D]C}dj||gƒ}t|ƒ|kr/|j|ƒ|}q/q/W|j|ƒdj|ƒS||jƒjddƒjdd|ƒSdS(s9 indent and justify text, rejustify (munge) if specified t s s N(RR RRtstripR(R RRtwidthtindentR!R#tword((s;/usr/lib/python2.7/dist-packages/zope/interface/document.pyRRs       (t__doc__tzope.interfaceRRRR(((s;/usr/lib/python2.7/dist-packages/zope/interface/document.pyts  .