mercurial/thirdparty/zope/interface/document.py
changeset 37178 68ee61822182
parent 37176 943d77fc07a3
equal deleted inserted replaced
37177:338367d44d34 37178:68ee61822182
    14 """ Pretty-Print an Interface object as structured text (Yum)
    14 """ Pretty-Print an Interface object as structured text (Yum)
    15 
    15 
    16 This module provides a function, asStructuredText, for rendering an
    16 This module provides a function, asStructuredText, for rendering an
    17 interface as structured text.
    17 interface as structured text.
    18 """
    18 """
    19 import zope.interface
       
    20 
    19 
       
    20 from __future__ import absolute_import
       
    21 
       
    22 from . import Interface
    21 
    23 
    22 def asStructuredText(I, munge=0, rst=False):
    24 def asStructuredText(I, munge=0, rst=False):
    23     """ Output structured text format.  Note, this will whack any existing
    25     """ Output structured text format.  Note, this will whack any existing
    24     'structured' format of the text.
    26     'structured' format of the text.
    25 
    27 
    39     if I.getDoc():
    41     if I.getDoc():
    40         outp(_justify_and_indent(_trim_doc_string(I.getDoc()), level))
    42         outp(_justify_and_indent(_trim_doc_string(I.getDoc()), level))
    41 
    43 
    42     bases = [base
    44     bases = [base
    43              for base in I.__bases__
    45              for base in I.__bases__
    44              if base is not zope.interface.Interface
    46              if base is not Interface
    45              ]
    47              ]
    46     if bases:
    48     if bases:
    47         outp(_justify_and_indent("This interface extends:", level, munge))
    49         outp(_justify_and_indent("This interface extends:", level, munge))
    48         level += 1
    50         level += 1
    49         for b in bases:
    51         for b in bases: