
    Vh+                     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                    |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 ]f  \  }}t        |d      rdj                   ||j                               |j                         xs d	      }
 |t        t	        |
      ||             h |dz  } |t        d
||             |dz  }|D ]z  \  }}t        |d      s|j                          |j                          }dj                   ||      |j                         xs d	      }
 |t        t	        |
      ||             | 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    G/home/dcms/DCMS/lib/python3.12/site-packages/zope/interface/document.pyinline_literalz(asStructuredText.<locals>.inline_literal%   s    s":    c                     | S )Nr   r   s    r
   r   z(asStructuredText.<locals>.inline_literal(   s    Hr      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hasattrformatr   join)ifacemungerstr   routplevelbasebasesbitemr   namedesc_calls                  r
   r   r      sO    		 
	()A88DE||~ !1%,,.!A5IJ DNN444  E   !:E5IJ
 	LAN199;77D$%5d%;UEJK	L 	
!%"<"<">?	]E5	9:	QJE* L
dt12$$t||~.3!3D $%5d%;UEJKL 
QJE	Z	67	QJE* L
d4-.||~&t'>'>'@&ABE$$u%3!3D $%5d%;UEJKL ;;q>F""Is   6%I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9r   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   `   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   o   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   
  :#z:Mr   