
    c                     8    d Z ddlZddgZddZddZd Zdd
ZdS )z Pretty-Print an Interface object as structured text (Yum)

This module provides a function, asStructuredText, for rendering an
interface as structured text.
    NasReStructuredTextasStructuredTextFc                    |rd }nd } ||                                            g}|j        }d}|                                 r8 |t          t	          |                                           |                     d | j        D             }|rp |t          d||                     |dz  }|D ]I}d ||                                           z  }	 |t          t	          |	          ||                     J|dz  }t          |                                           }
 |t          d||                     |dz  }|
D ]r\  }}t          |d          s] ||                                           d	|                                pd
}	 |t          t	          |	          ||                     s|dz  } |t          d||                     |dz  }|
D ]\  }}t          |d          ru|                                 |	                                } ||          d	|                                pd
}	 |t          t	          |	          ||                     d
                    |          dz   S )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                     d| dS )Nz`` ss    7lib/python3.11/site-packages/zope/interface/document.py<lambda>z"asStructuredText.<locals>.<lambda>#   s     qqq?     c                     | S )Nr   r   s    r
   r   z"asStructuredText.<locals>.<lambda>%   s    1 r      c                 8    g | ]}|t           j        j        u|S r   )zope	interface	Interface).0bases     r
   
<listcomp>z$asStructuredText.<locals>.<listcomp>.   s7       DN44T   r   zThis interface extends:zo %szAttributes:getSignatureStringz -- zno documentationzMethods:z

)getNameappendgetDoc_justify_and_indent_trim_doc_string	__bases__sortednamesAndDescriptionshasattrr   join)Imungerstinline_literalroutplevelbasesbitemr   namedesc_calls                 r
   r   r      s     %22$				$	$%A8DExxzz G !1!((**!=!=uEEFFF   E   !:E5IIJJJ
 	L 	LANN199;;777DD$%5d%;%;UEJJKKKK
!!"8"8":":;;D	]E5	9	9:::	QJE* L L
dt122 	L!/!?!?!?!?!%!D2D!DFDD$%5d%;%;UEJJKKK	QJED	Z	6	6777	QJE* L L
d4-.. 	L"llnnnd.E.E.G.G.GHE!/!6!6!6!6!%!D2D!DFDD$%5d%;%;UEJJKKK;;q>>F""r   c                 &    t          | |d          S )zi Output reStructuredText format.  Note, this will whack any existing
    'structured' format of the text.T)r"   r#   )r   )r!   r"   s     r
   r   r   Q   s     AU5555r   c                 $   |                      dd                              d          }|                    d          g}|r;t          d |D                       }|D ]}|                    ||d                     d                    |          S )zJ Trims a doc string to make it format
    correctly with structured text. 

r   c                 p    g | ]3}t          |          t          |                                          z
  4S r   )lenlstrip)r   lines     r
   r   z$_trim_doc_string.<locals>.<listcomp>^   sC     - - -" d))c$++--&8&88 - - -r   N)replacesplitpopminr   r    )textlinesnlines
min_indentr5   s        r
   r   r   W   s     LL&&,,T22Eiill^F - - -&+- - - . .
 	- 	-DMM$z{{+,,,,99Vr   H   c                    d|z  }|rg }|}|                                  } | D ]C}d                    ||g          }t          |          |k    r|                    |           |}D|                    |           d                    |          S ||                                                     dd                              dd|z             z   S )z9 indent and justify text, rejustify (munge) if specified  r1   r0   )r7   r    r3   r   stripr6   )r:   r'   r"   widthindentr;   r5   words           r
   r   r   f   s     5[F Mzz|| 	 	D88T4L))D4yy5  T"""LLyy JJLL  ..77dVmLLM 	Mr   )r   F)r   )r   r>   )__doc__zope.interfacer   __all__r   r   r   r   r   r   r
   <module>rH      s    
     
4# 4# 4# 4#n6 6 6 6  M M M M M Mr   