B
    öÀ„\Á  ã               @   s"   d Z ddlZddd„Zdd„ ZdS )	zÒ
    sphinx.util.docstrings
    ~~~~~~~~~~~~~~~~~~~~~~

    Utilities for docstring processing.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    Né   c             C   sè   |   ¡  ¡ }tj}x:||d… D ]*}t| ¡ ƒ}|r t|ƒ| }t||ƒ}q W x,t|ƒD ] }|t|ƒk rX||  ¡ ||< qXW |tjk r²x*t|t|ƒƒD ]}|| |d… ||< q–W x|rÌ|d sÌ| d¡ q´W |rä|d rä| 	d¡ |S )a—  Convert a docstring into lines of parseable reST.  Remove common leading
    indentation, where the indentation of a given number of lines (usually just
    one) is ignored.

    Return the docstring as a list of lines usable for inserting into a docutils
    ViewList (used as argument of nested_parse().)  An empty line is added to
    act as a separator between this docstring and following content.
    Nr   éÿÿÿÿÚ )
Ú
expandtabsÚ
splitlinesÚsysÚmaxsizeÚlenÚlstripÚminÚrangeÚpopÚappend)ÚsÚignoreÚlinesZmarginÚlineZcontentÚindentÚi© r   ú5lib/python3.7/site-packages/sphinx/util/docstrings.pyÚprepare_docstring   s$    


r   c             C   s~   g }dd„ |   ¡  ¡ D ƒ}xH|D ]@}| d¡r |dd… }|rV|d dkrV|dd… }| |¡ q W |rz|d	 rz| d
¡ |S )z˜Extract documentation comment lines (starting with #:) and return them
    as a list of lines.  Returns an empty list if there is no documentation.
    c             S   s   g | ]}|  ¡ ‘qS r   )Ústrip)Ú.0r   r   r   r   ú
<listcomp>;   s    z&prepare_commentdoc.<locals>.<listcomp>z#:é   Nr   ú r   r   r   )r   r   Ú
startswithr   )r   Úresultr   r   r   r   r   Úprepare_commentdoc5   s    


r   )r   )Ú__doc__r   r   r   r   r   r   r   Ú<module>
   s   
"