o
    >h+                     @   s>   d Z ddlZddgZdddZdddZdd	 Zd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                 C   s  |rdd }ndd }||   g}|j}d}|  r&|tt|  | dd | jD }|rW|td|| |d7 }|D ]}d||   }	|tt|	|| q>|d8 }t|  }
|td	|| |d7 }|
D ]!\}}t|d
sd	||  | pd}	|tt|	|| qk|d8 }|td|| |d7 }|
D ])\}}t|d
r|   |
  }d	||| pd}	|tt|	|| qd|d 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                 S   s   d|  dS )Nz`` sr   r   w/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/zope/interface/document.pyinline_literal%   s   z(asStructuredText.<locals>.inline_literalc                 S   s   | S )Nr   r   r   r   r   r   (   s      c                 S   s   g | ]
}|t jjur|qS r   )zope	interface	Interface).0baser   r   r   
<listcomp>2   s
    z$asStructuredText.<locals>.<listcomp>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_callr   r   r   r      sT   





c                 C   s   t | |ddS )zi Output reStructuredText format.

    Note, this will whack any existing 'structured' format of the text.T)r   r   )r   )r   r   r   r   r   r   Y   s   c                 C   sZ   |  ddd}|dg}|r(tdd |D }|D ]}|||d  qd|S )zJ Trims a doc string to make it format
    correctly with structured text. 

r   c                 S   s    g | ]}t |t |  qS r   )lenlstrip)r   liner   r   r   r   g   s    z$_trim_doc_string.<locals>.<listcomp>N)replacesplitpopminr   r   )textlinesnlines
min_indentr,   r   r   r   r   `   s   
r   H   c                 C   s   d| }|r1g }|}|   } | D ]}d||g}t||kr&|| |}q|| d|S ||  dddd|  S )z9 indent and justify text, rejustify (munge) if specified  r)   r(   )r.   r   r*   r   stripr-   )r1   r!   r   widthindentr2   r,   wordr   r   r   r   o   s    


r   )r   F)r   )r   r5   )__doc__zope.interfacer
   __all__r   r   r   r   r   r   r   r   <module>   s   

=