
    Ng                     6    d Z ddlZddgZd	dZd
dZd ZddZy)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asStructuredTextc                 f   |rd }nd } || j                               g}|j                  }d}| j                         r) |t        t	        | j                               |             | j
                  D cg c]   }|t        j                  j                  ur|" }}|rY |t        d||             |dz  }|D ]7  }	d ||	j                               z  }
 |t        t	        |
      ||             9 |dz  }t        | j                               } |t        d||             |dz  }|D ][  \  }}t        |d      r ||j                               d|j                         xs d	}
 |t        t	        |
      ||             ] |dz  } |t        d
||             |dz  }|D ]o  \  }}t        |d      s|j                         |j                         } ||      d|j                         xs d	}
 |t        t	        |
      ||             q dj                  |      dz   S c c}w )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    R/var/www/djangounited/venv/lib/python3.12/site-packages/zope/interface/document.py<lambda>z"asStructuredText.<locals>.<lambda>#   s    q?     c                     | S )Nr   r   s    r
   r   z"asStructuredText.<locals>.<lambda>%   s    1 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__zope	interface	InterfacesortednamesAndDescriptionshasattrr   join)Imungerstinline_literalroutplevelbasebasesbitemr   namedesc_calls                  r
   r   r      s9    2$				$%A88DExxz !1!((*!=uEF DNN444  E   !:E5IJ
 	LAN199;77D$%5d%;UEJK	L 	
!!"8"8":;	]E5	9:	QJE* L
dt12!/!?!%!D2D!DFD$%5d%;UEJK	L
 
QJE	Z	67	QJE* L
d4-."llnd.E.E.GHE!/!6!%!D2D!DFD$%5d%;UEJKL ;;q>F""As   6%H.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5r   c           
      F   | j                  dd      j                  d      }|j                  d      g}|rWt        |D cg c]'  }t	        |      t	        |j                               z
  ) c}      }|D ]  }|j                  ||d         dj                  |      S c c}w )zJ Trims a doc string to make it format
    correctly with structured text. 

r   N)replacesplitpopminlenlstripr   r   )textlinesnlinesline
min_indents        r
   r   r   W   s     LL&,,T2Eiil^F&+-" d)c$++-&88 - .
 	-DMM$z{+,	- 99V-s   ,Bc                 `   d|z  }|rrg }|}| j                         } | D ]7  }dj                  ||g      }t        |      |kD  s%|j                  |       |}9 |j                  |       dj                  |      S || j	                         j                  dd      j                  dd|z         z   S )z9 indent and justify text, rejustify (munge) if specified  r.   r-   )r0   r   r3   r   stripr/   )r5   r#   r   widthindentr6   r8   words           r
   r   r   f   s     5[Fzz| 	D88T4L)D4y5 T"		 LLyy JJL  .77dVmLM 	Mr   )r   F)r   )r   H   )__doc__zope.interfacer   __all__r   r   r   r   r   r   r
   <module>rD      s4   
  
4#n6Mr   