
    Of+                     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                 8   |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          r|                                  |
                                 }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    I/var/www/html/env/lib/python3.11/site-packages/zope/interface/document.pyinline_literalz(asStructuredText.<locals>.inline_literal%   s    :::    c                     | S )Nr   r   s    r
   r   z(asStructuredText.<locals>.inline_literal(   s    Hr      c                 8    g | ]}|t           j        j        u|S r   )zope	interface	Interface).0bases     r
   
<listcomp>z$asStructuredText.<locals>.<listcomp>2   s2       DN444 444r   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hasattrformatr   join)ifacemungerstr   routplevelbasesbitemr   namedesc_calls                 r
   r   r      s     	 	 	 		 	 	 
	(	()A8DE||~~ K !1%,,..!A!A5IIJJJ   E   !:E5IIJJJ
 	L 	LANN199;;777DD$%5d%;%;UEJJKKKK
!%"<"<">">??D	]E5	9	9:::	QJE* L L
dt122 	L$$t||~~..3!3 D D$%5d%;%;UEJJKKK	QJED	Z	6	6777	QJE* L L
d4-.. 	L||~~Bt'>'>'@'@BBE$$u%%3!3 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   Y   s     ED9999r   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>g   sC     - - -" d))c$++--&8&88 - - -r   N)replacesplitpopminr   r!   )textlinesnlines
min_indentr5   s        r
   r   r   `   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   o   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    
     :# :# :# :#z: : : :  M M M M M Mr   