ok

Mini Shell

Direktori : /lib64/python3.6/site-packages/zope/interface/__pycache__/
Upload File :
Current File : //lib64/python3.6/site-packages/zope/interface/__pycache__/document.cpython-36.pyc

3

��[��@s6dZddlZd
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.
�NFcCs�|rdd�}ndd�}||j��g}|j}d}|j�rL|tt|j��|��dd�|jD�}|r�|td||��|d7}x0|D](}d||j��}	|tt|	�||��q~W|d8}t|j��}
|td	||��|d7}xL|
D]D\}}t|d
�s�d||j��|j��pdf}	|tt|	�||��q�W|d8}|td
||��|d7}x`|
D]X\}}t|d
��rJd|j�|j	�f}
d||
�|j��p�df}	|tt|	�||���qJWdj
|�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� /usr/lib64/python3.6/document.py�<lambda>sz"asStructuredText.<locals>.<lambda>cSs|S)Nr)rrrrr!s�cSsg|]}|tjjk	r|�qSr)�zopeZ	interfaceZ	Interface)�.0�baserrr�
<listcomp>*sz$asStructuredText.<locals>.<listcomp>zThis interface extends:zo %szAttributes:�getSignatureStringz%s -- %szno documentationzMethods:z%s%sz

)ZgetName�appendZgetDoc�_justify_and_indent�_trim_doc_string�	__bases__�sorted�namesAndDescriptions�hasattrr�join)�I�munge�rstZinline_literal�rZoutp�level�bases�b�itemr�nameZdescZ_callrrr�asStructuredTextsF



rcCst||dd�S)zi Output reStructuredText format.  Note, this will whack any existing
    'structured' format of the text.T)rr)r)rrrrr�asReStructuredTextMsrcCs^|jdd�jd�}|jd�g}|rTtdd�|D��}x|D]}|j||d��q:Wdj|�S)zJ Trims a doc string to make it format
    correctly with structured text. z
�
rcSs g|]}t|�t|j���qSr)�len�lstrip)r�linerrrr
Zsz$_trim_doc_string.<locals>.<listcomp>N)�replace�split�pop�minrr)�text�linesZnlinesZ
min_indentr"rrrrSs

r�HcCs�d|}|rfg}|}|j�}x>|D],}dj||g�}t|�|kr"|j|�|}q"W|j|�dj|�S||j�jdd�jdd|�SdS)z9 indent and justify text, rejustify (munge) if specified � rz
N)r$rr r�stripr#)r'rr�width�indentr(r"Zwordrrrr
bs



r
)rF)r)rr))�__doc__Zzope.interfacerrrrr
rrrr�<module>s

7


Zerion Mini Shell 1.0