Ñò
¶TJJc @ s: d Z d d k Z d d „ Z d „ Z d d d „ Z d S( sÔ Pretty-Print an Interface object as structured text (Yum)
This module provides a function, asStructuredText, for rendering an
interface as structured text.
$Id: document.py 39768 2005-10-31 13:57:35Z tlotze $
iÿÿÿÿNi c
C sI | i ƒ g } | i } d } | i ƒ o# | t t | i ƒ ƒ | ƒ ƒ n g } | i D]$ } | t i i j o | | q\ q\ ~ } | ok | t d | | ƒ ƒ | d 7} x: | D]2 } d | i ƒ } | t t | ƒ | | ƒ ƒ q· W| d 8} n | i ƒ }
|
i
ƒ | t d | | ƒ ƒ | d 7} xg |
D]_ \ } } t | d ƒ pC d | i ƒ | i ƒ p d f } | t t | ƒ | | ƒ ƒ q8q8W| d 8} | t d | | ƒ ƒ | d 7} xp |
D]h \ } } t | d ƒ oL d | i ƒ | i ƒ | i ƒ p d f } | t t | ƒ | | ƒ ƒ qÌqÌWd
i
| ƒ d
S( sj Output structured text format. Note, this will whack any existing
'structured' format of the text. i s This interface extends:s o %ss Attributes:t getSignatureStrings %s -- %ss no documentations Methods:s
%s%s -- %ss
( t getNamet appendt getDoct _justify_and_indentt _trim_doc_stringt __bases__t zopet interfacet Interfacet namesAndDescriptionst sortt hasattrR t join(
t It munget rt outpt levelt _[1]t baset basest bt itemR
t namet desc( ( s= /usr/lib64/python2.6/site-packages/zope/interface/document.pyt asStructuredText sJ
#
'
$
$c C s¤ | i d d ƒ i d ƒ } | i d ƒ g } | oc t g } | D]# } | t | ƒ t | i ƒ ƒ qB ~ ƒ } x# | D] } | i | | ƒ qx Wn d i | ƒ S( sJ Trims a doc string to make it format
correctly with structured text. s
s
i ( t replacet splitt popt mint lent lstripR R
( t textt linest nlinesR t linet
min_indent( ( s= /usr/lib64/python2.6/site-packages/zope/interface/document.pyR F s
3 iH c C s d | } | oƒ g } | } | i ƒ } xZ | D]E } d i | | g ƒ } t | ƒ | j o | i | ƒ | } q0 q0 W| i | ƒ d i | ƒ S| | i ƒ i d d ƒ i d d | ƒ Sd S( s9 indent and justify text, rejustify (munge) if specified t s
s
N( R R
R R t stripR ( R! R R t widtht indentR" R$ t word( ( s= /usr/lib64/python2.6/site-packages/zope/interface/document.pyR U s
( t __doc__t zope.interfaceR R R R ( ( ( s= /usr/lib64/python2.6/site-packages/zope/interface/document.pyt