Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/zope/interface/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/zope/interface/__pycache__/document.cpython-37.pyc

B

R^��@s>dZddlZddgZd
dd�Zddd�Zdd	�Zddd�ZdS)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�asStructuredTextFcCs�|rdd�}ndd�}||���g}|j}d}|��rL|tt|���|��dd�|jD�}|r�|td||��|d7}x0|D](}d||���}	|tt|	�||��q~W|d8}t|���}
|td	||��|d7}xL|
D]D\}}t|d
�s�d||���|���pdf}	|tt|	�||��q�W|d8}|td
||��|d7}x`|
D]X\}}t|d
��rJd|��|�	�f}
d||
�|���p�df}	|tt|	�||���qJWd�
|�dS)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.
    cSs
d|fS)Nz``%s``�)�srr�J/opt/alt/python37/lib64/python3.7/site-packages/zope/interface/document.py�<lambda>#�z"asStructuredText.<locals>.<lambda>cSs|S)Nr)rrrrr%r�cSsg|]}|tjjk	r|�qSr)�zope�	interfaceZ	Interface)�.0�baserrr�
<listcomp>.sz$asStructuredText.<locals>.<listcomp>zThis interface extends:zo %szAttributes:�getSignatureStringz%s -- %szno documentationzMethods:z%s%sz

)�getName�appendZgetDoc�_justify_and_indent�_trim_doc_string�	__bases__�sorted�namesAndDescriptions�hasattrr�join)�I�munge�rstZinline_literal�rZoutp�level�bases�b�itemr�name�descZ_callrrrrsF



cCst||dd�S)zi Output reStructuredText format.  Note, this will whack any existing
    'structured' format of the text.T)rr)r)rrrrrrQscCs^|�dd��d�}|�d�g}|rTtdd�|D��}x|D]}|�||d��q:Wd�|�S)zJ Trims a doc string to make it format
    correctly with structured text. z
�
rcSs g|]}t|�t|����qSr)�len�lstrip)r�linerrrr^sz$_trim_doc_string.<locals>.<listcomp>N)�replace�split�pop�minrr)�text�linesZnlinesZ
min_indentr&rrrrWs

r�HcCs�d|}|rfg}|}|��}x>|D],}d�||g�}t|�|kr"|�|�|}q"W|�|�d�|�S||���dd��dd|�SdS)z9 indent and justify text, rejustify (munge) if specified � r#z
N)r(rr$r�stripr')r+rr�width�indentr,r&�wordrrrrfs



r)rF)r)rr-)�__doc__Zzope.interfacer
�__all__rrrrrrrr�<module>s
7