
    z	i                         S SK r S SKJr  S SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  \
R                  " \5      rS	 rS
 rSS jr " S S\R*                  5      rS rg)    N)nodes)rst)
directives)ViewList)logging)nested_parse_with_titles)	extensionc                 @    [         R                  " U 5      =(       d    S$ )N )inspectgetdoc)plugins    M/home/james-whalen/.local/lib/python3.13/site-packages/stevedore/sphinxext.py_get_docstringr      s    >>&!'R'    c              #   &  #    [        U R                  5       5       Hp  nX   n[        UR                  5      =(       d    SnUR	                  5       S   R                  5       nSR                  UR                  U5      UR                  4v   Mr     g 7f)N
r   z
* {} -- {})	sortednamesr   r   
splitlinesstripformatnamemodule_name)mgrr   extdocsummarys        r   _simple_listr      ss     syy{#iSZZ(0D.."1%++-""388W5  	 	 $s   BBc              #     #    [        U R                  5       5       GH,  nX   nU(       a&  U[        UR                  5      -  UR                  4v   U(       a)  UR                  R                  5       UR                  4v   OUR                  UR                  4v   U(       a&  U[        UR                  5      -  UR                  4v   SUR                  4v   [        UR                  5      nU(       a  XeR                  4v   O4SR                  UR                  UR                  5      UR                  4v   SUR                  4v   GM/     g 7f)Nr   z0.. warning:: No documentation found for {} in {})
r   r   lenr   r   titler   r   r   entry_point_target)r   overunder	titlecaser   r   r   s          r   _detailed_listr'   (   s     syy{#i#chh-'9988>>#S__5588S__--3sxx=(#//::S__%%SZZ((( CIIHHc44 	  S__%%+ $s   EEc                       \ rS rSrSr\R                  \R                  \R                  \R                  \R                  S.r	Sr
S rSrg)ListPluginsDirectiveA   z4Present a simple list of the plugins in a namespace.)classdetailedr&   overline-styleunderline-styleTc                    SR                  U R                  5      R                  5       n[        R	                  SU-  5        U R
                  R                  SS5      nU R
                  R                  SS5      nS n[        R                  " UUS9n[        5       nS	U R
                  ;   nS
U R
                  ;   a  [        XRUUS9nO[        U5      nU H-  u  pU	R                  5        H  nUR                  X5        M     M/     [        R                  " 5       nU R                   R"                  Ul        [%        U R                   Xl5        UR&                  $ )N zdocumenting plugins from %rr-   r   r.   =c                 b    [         R                  SR                  UR                  U5      5        g )NzFailed to load {}: {})LOGwarningr   module)r   eperrs      r   report_load_failure5ListPluginsDirective.run.<locals>.report_load_failureT   s     KK/66ryy#FGr   )on_load_failure_callbackr&   r,   )r$   r%   r&   )joincontentr   r3   infooptionsgetr	   ExtensionManagerr   r'   r   r   appendr   sectionstatedocumentr   children)self	namespaceoverline_styleunderline_styler8   r   resultr&   datatextsourcelinenodes                r   runListPluginsDirective.runN   s   HHT\\*002	.:;))*:B?,,**+<cB	H ((%8

 4<</	%!#%D  $D LD)d+ * !
 }}

++ V:}}r    N)__name__
__module____qualname____firstlineno____doc__r   class_optionflagsingle_char_or_unicodeoption_spechas_contentrP   __static_attributes__rR   r   r   r)   r)   A   sC    > ((OO__$;;%<<K K!r   r)   c                 b    [         R                  S5        U R                  S[        5        SSS.$ )Nzloading stevedore.sphinxextzlist-pluginsT)parallel_read_safeparallel_write_safe)r3   r=   add_directiver)   )apps    r   setuprc   r   s0    HH*+n&:;"# r   )r   -F)r   docutilsr   docutils.parsersr   docutils.parsers.rstr   docutils.statemachiner   sphinx.utilr   sphinx.util.nodesr   	stevedorer	   	getLoggerrS   r3   r   r   r'   	Directiver)   rc   rR   r   r   <module>rn      sT        + *  6 !( &2.3== .br   