
    /Jf                     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                 X   |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 ]\  }}t          |d          sld		                     ||                                           |                                pd
          }	 |t          t	          |	          ||                     |dz  } |t          d||                     |dz  }|
D ]\  }}t          |d          rd	                    |                                 |
                                          }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                     |           S )Nz``{}``)formatss    Z/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/zope/interface/document.py<lambda>z"asStructuredText.<locals>.<lambda>$   s    8??1#5#5     c                     | S )N 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>/   s2       DN444 444r   zThis interface extends:zo %szAttributes:getSignatureStringz{} -- {}zno documentationzMethods:z{}{}z

)getNameappendgetDoc_justify_and_indent_trim_doc_string	__bases__sortednamesAndDescriptionshasattrr   r   join)Imungerstinline_literalroutplevelbasesbitemr   namedesc_calls                 r
   r   r      s     %55$				$	$%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$$^^DLLNN%C%C!%!D2DF FDD$%5d%;%;UEJJKKK	QJED	Z	6	6777	QJE* L L
d4-.. 	LMM$,,..$2I2I2K2KLLE$$^^E%:%:!%!D2DF 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   R   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_indentr6   s        r
   r   r   X   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  r2   r1   )r8   r!   r4   r   stripr7   )r;   r(   r#   widthindentr<   r6   words           r
   r   r   g   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>rI      s    
     
4# 4# 4# 4#n6 6 6 6  M M M M M Mr   