%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/utils/ |
| Current File : //proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/utils/doc.pyo |
�
���^c @@ s{ d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m
Z
e j e � Z
d � Z d � Z d S( u,
Functions for analyzing/parsing docstrings
i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ s@ x9t j | � D](\ } } t j d | � | s8 q n t j rG | n t j j j | � } x� d d d d d f D]� \ } } t j r� t j j j | � } t j j j | � } n y t
j | | | � } Wqr t k
r� t j d | | d
t
�qr Xqr Wt j rt j j j | � } n | | k r | | | <q q W| S( uA
Strip/replace reStructuredText directives in docstrings
u Stripping docstring for %su *.. code-block:: \S+\n{1,2}u u .. note::u Note:u .. warning::u Warning:u .. versionadded::u New in versionu .. versionchanged::u Changed in versionuJ Exception encountered while matching regex %r to docstring for function %st exc_info( u *.. code-block:: \S+\n{1,2}u ( u .. note::u Note:( u .. warning::u Warning:( u .. versionadded::u New in version( u .. versionchanged::u Changed in version( R t iteritemst logt debugt PY3t saltt utilst datat encodet PY2t ret subt Exceptiont Truet decode( t docst funct docstringt
docstring_newt regext repl( ( s2 /usr/lib/python2.7/site-packages/salt/utils/doc.pyt strip_rst s4 $
c @ s i | d 6} d } t j | | t j � } | r� g } d } xE | j d � j � j � D]( } | j t j | | � j d � � qY W| | d <| Sd � | j � } t � f d � | D� � } | s� g | d <| S| d j � d � j � j d
� } | | d <| Sd S( u
Parse a docstring into its parts.
Currently only parses dependencies, can be extended to parse whatever is
needed.
Parses into a dictionary:
{
'full': full docstring,
'deps': list of dependencies (empty list if none)
}
u fullu@ ([ \t]*):depends:[ \t]+- (\w+)[^\n]*\n(\1[ \t]+- (\w+)[^\n]*\n)*u - (\w+)i i u depsu Required python modules: c 3@ s* | ] } | j � j � � r | Vq d S( N( t stript
startswith( t .0t x( t txt( s2 /usr/lib/python2.7/site-packages/salt/utils/doc.pys <genexpr>M s u u , N(
R t searcht Mt groupR t
splitlinest appendt listt replacet split( R t retR t matcht depst lineR t dep_list( ( R s2 /usr/lib/python2.7/site-packages/salt/utils/doc.pyt parse_docstring1 s&