ó
öĄ\c           @   sD   d  Z  d d l Z e r+ d d l m Z n  d d  Z d   Z d S(   sŅ   
    sphinx.util.docstrings
    ~~~~~~~~~~~~~~~~~~~~~~

    Utilities for docstring processing.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i’’’’N(   t   Listi   c         C   s7  |  j    j   } t j } xL | | D]@ } t | j    } | r& t |  | } t | |  } q& q& Wx= t |  D]/ } | t |  k  rw | | j   | | <qw qw W| t j k  rī x2 t | t |   D] } | | | | | <qĻ Wn  x" | r| d r| j d  qń W| r3| d r3| j	 d  n  | S(   s  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.
    i    i’’’’t    (
   t
   expandtabst
   splitlinest   syst   maxsizet   lent   lstript   mint   ranget   popt   append(   t   st   ignoret   linest   margint   linet   contentt   indentt   i(    (    s5   lib/python2.7/site-packages/sphinx/util/docstrings.pyt   prepare_docstring   s$    
	c         C   s²   g  } g  |  j    j   D] } | j   ^ q } xZ | D]R } | j d  r8 | d } | rz | d d k rz | d } n  | j |  q8 q8 W| r® | d r® | j d  n  | S(   s   Extract documentation comment lines (starting with #:) and return them
    as a list of lines.  Returns an empty list if there is no documentation.
    s   #:i   i    t    i   i’’’’R   (   R   R   t   stript
   startswithR   (   R   t   resultR   R   (    (    s5   lib/python2.7/site-packages/sphinx/util/docstrings.pyt   prepare_commentdoc5   s    +
(   t   __doc__R   t   Falset   typingR    R   R   (    (    (    s5   lib/python2.7/site-packages/sphinx/util/docstrings.pyt   <module>
   s
   "