
    Pe\3                     ^    d dl Z  e j                  d      ZdZ G d d      Z G d de      Zy)    Nbcdocs).,?!:;c                       e Zd ZddZed        Zej                  d        Zd Zd Zd Z	d Z
d Zdd
Zd Zd Zd Zd Zd Zy	)	BaseStylec                 <    || _         || _        d| _        d| _        y )Nr   T)docindent_width_indent	keep_dataselfr   r   s      ;/usr/lib/python3/dist-packages/botocore/docs/bcdoc/style.py__init__zBaseStyle.__init__   s    (    c                     | j                   S Nr   r   s    r   indentationzBaseStyle.indentation   s    ||r   c                     || _         y r   r   )r   values     r   r   zBaseStyle.indentation    s	    r   c                 (    d| j                         z  S Nz
%s)spacesr   s    r   new_paragraphzBaseStyle.new_paragraph$   s    %%r   c                 .    | xj                   dz  c_         y )N   r   r   s    r   indentzBaseStyle.indent'   s    r   c                 N    | j                   dkD  r| xj                   dz  c_         y y Nr   r"   r   r   s    r   dedentzBaseStyle.dedent*   s!    <<!LLAL r   c                 :    d| j                   | j                  z  z  S )N )r   r   r   s    r   r   zBaseStyle.spaces.   s    dllT%6%6677r   c                     |S r    r   ss     r   boldzBaseStyle.bold1       r   Nc                     |S r   r*   )r   linktitles      r   refzBaseStyle.ref4   s    r   c                     |S r   r*   r+   s     r   h2zBaseStyle.h27   r.   r   c                     |S r   r*   r+   s     r   h3zBaseStyle.h3:   r.   r   c                     |S r   r*   r+   s     r   	underlinezBaseStyle.underline=   r.   r   c                     |S r   r*   r+   s     r   italicszBaseStyle.italics@   r.   r   c                     | j                   j                         }|d}|dk7  r|d   dk7  r|dz  }| j                   j                  |       y )N r(   )r   	pop_write
push_write)r   
last_writes     r   $add_trailing_space_to_previous_writez.BaseStyle.add_trailing_space_to_previous_writeC   sP     XX'')
J
2# 5#JJ'r      r   )__name__
__module____qualname__r   propertyr   setterr    r#   r&   r   r-   r2   r4   r6   r8   r:   rA   r*   r   r   r   r      sl        &8(r   r   c                      e Zd ZdBdZd Zd Zd Zd ZdCdZd Z	dCd	Z
d
 Zd ZdCdZd Zd Zd Zd ZdCdZd Zd ZdCdZd ZdCdZd Zd ZdCdZd ZdCdZd ZdCdZd ZdCdZ d  Z!dCd!Z"d" Z#dCd#Z$dCd$Z%d% Z&dCd&Z'd' Z(d( Z)dCd)Z*d* Z+dCd+Z,d, Z-dCd-Z.d. Z/dCd/Z0d0 Z1dCd1Z2d2 Z3d3 Z4d4 Z5dCd5Z6d6 Z7d7 Z8dDd8Z9d9 Z:d: Z;dCd;Z<d< Z=d= Z>d> Z?d? Z@d@ ZAdA ZBy)E	ReSTStylec                 \    t         j                  | ||       d| _        d | _        d| _        y )NTr   )r   r   do_pa_href
list_depthr   s      r   r   zReSTStyle.__init__O   s)    4l3	r   c                 \    | j                   j                  d| j                         z         y Nz

%sr   writer   r   s    r   r    zReSTStyle.new_paragraphU   s    x$++-/0r   c                 \    | j                   j                  d| j                         z         y r   rQ   r   s    r   new_linezReSTStyle.new_lineX   s    v-.r   c                     	 | j                   j                         }|dv r |dv r| j                   j                  d       	 | j                   j                  |       y # t        $ r Y 'w xY w)N)***r(   )r   
peek_writerR   
IndexErrorr   markupr@   s      r   _start_inlinezReSTStyle._start_inline[   s^    	$,,.J [(V{-Bs#v  		s   A 	A('A(c                     | j                   j                         }||k(  ry | j                   j                  |       | j                   j                  |       y r   )r   r>   r?   rR   rZ   s      r   _end_inlinezReSTStyle._end_inlineg   sC    
 XX'')
J'vr   Nc                 &    | j                  d       y NrW   r\   r   attrss     r   
start_boldzReSTStyle.start_boldr   s    4 r   c                 &    | j                  d       y r`   r^   r   s    r   end_boldzReSTStyle.end_boldu   s    r   c                 H    d| j                   _        | j                  |       y NT)r   do_translationrd   rb   s     r   start_bzReSTStyle.start_bx   s    "&r   c                 F    d| j                   _        | j                          y NF)r   rj   rg   r   s    r   end_bzReSTStyle.end_b|   s    "'r   c                     |r<| j                          | j                  j                  |       | j                          y y r   )rd   r   rR   rg   r+   s     r   r-   zReSTStyle.bold   -    OOHHNN1MMO r   c                 P    ||}| j                   j                  d| d| d       y )N:doc:` <>`)r   rR   r   r1   r0   s      r   r2   zReSTStyle.ref   s+    <Dwbb12r   c                     |t        |      z  }| j                          | j                  j                  | d| d|        | j                          y )N
)lenr    r   rR   )r   r,   border_charborders       r   _headingzReSTStyle._heading   sI    s1v%&A3b12r   c                 (    | j                  |d       y NrV   r{   r+   s     r   h1zReSTStyle.h1       ar   c                 (    | j                  |d       y )N=r~   r+   s     r   r4   zReSTStyle.h2   r   r   c                 (    | j                  |d       y )N-r~   r+   s     r   r6   zReSTStyle.h3   r   r   c                 &    | j                  d       y r}   ra   rb   s     r   start_italicszReSTStyle.start_italics   s    3r   c                 &    | j                  d       y r}   rf   r   s    r   end_italicszReSTStyle.end_italics   s    r   c                     |r<| j                          | j                  j                  |       | j                          y y r   )r   r   rR   r   r+   s     r   r:   zReSTStyle.italics   s2     HHNN1 r   c                 v    | j                   r-| j                  j                  d| j                         z         y y rP   rL   r   rR   r   rb   s     r   start_pzReSTStyle.start_p   )    99HHNN8dkkm34 r   c                 v    | j                   r-| j                  j                  d| j                         z         y y rP   r   r   s    r   end_pzReSTStyle.end_p   r   r   c                 h    d| j                   _        | j                          | j                  d       y )NT``)r   rj   rA   r\   rb   s     r   
start_codezReSTStyle.start_code   s(    "&1134 r   c                 H    d| j                   _        | j                  d       y )NFr   )r   rj   r^   r   s    r   end_codezReSTStyle.end_code   s    "'r   c                     |r<| j                          | j                  j                  |       | j                          y y r   )r   r   rR   r   r+   s     r   codezReSTStyle.code   rp   r   c                     | j                          | j                  j                  d       | j                          | j                          y )Nz	.. note::r    r   rR   r#   rb   s     r   
start_notezReSTStyle.start_note   s3    {#r   c                 D    | j                          | j                          y r   r&   r    r   s    r   end_notezReSTStyle.end_note       r   c                     | j                          | j                  j                  d       | j                          | j                          y )Nz.. warning::r   rb   s     r   start_importantzReSTStyle.start_important   s3    ~&r   c                 D    | j                          | j                          y r   r   r   s    r   end_importantzReSTStyle.end_important   r   r   c                     | j                          | j                  j                  d       | j                          | j                          y )Nz.. danger::r   rb   s     r   start_dangerzReSTStyle.start_danger   s3    }%r   c                 D    | j                          | j                          y r   r   r   s    r   
end_dangerzReSTStyle.end_danger   r   r   c                    | j                          |rA|D ];  \  }}|dk(  s|j                         | _        | j                  j	                  d       = n| j                  j	                  d       d| j                  _        y )Nhref`r(   T)rA   striprM   r   rR   rj   )r   rc   attr_key
attr_values       r   start_azReSTStyle.start_a   so     	113(- ($*v% #-"2"2"4DKHHNN3'( HHNN3"&r   c                 F    | j                   j                  d| d|        y )Nz.. _z: )r   writeln)r   refnamer0   s      r   link_target_definitionz ReSTStyle.link_target_definition   s!    4y4&12r   c                     ||}| j                   j                  dk(  r#| j                   j                  d| d| d       y | j                   j                  |       y )Nhtmlz:ref:`rs   rt   r   targetrR   )r   labeltexts      r   sphinx_reference_labelz ReSTStyle.sphinx_reference_label   sK    <D88??f$HHNNVD6E7"56HHNN4 r   c                 &   | j                   }|j                         }|j                  d      s%|j                         |z   }|j                  d      s%|dk7  r:|j                  d      rd|dd  j                  d       }|j	                  |       y y )Nr   r<   z` r"   r(   )r   r>   
startswithlstripr?   )r   r   r@   s      r   _clean_link_textzReSTStyle._clean_link_text   s    hh]]_
'',:5J '',$$T* AB!6!6s!; <=
NN:&	 r   c                    d| j                   _        | j                  r?| j                          | j                   j	                         }|j                  d      }|r_|dk7  rZd|v r|j                  dd      }| j                   j                  |       | j                   j                  d| j                  z         n|dk(  r)| j                   j                  d| j                  z         nm| j                   j                  | j                         | j                  | j                   j                  | j                  <   | j                   j                  d       d | _        y y )	NFr(   r   r   z\:z <%s>`__z`<%s>`__z`__)
r   rj   rM   r   r>   rstripreplacer?   hrefsrR   )r   
next_childr@   s      r   end_azReSTStyle.end_a  s   "';;!!#++-J#**3/JjC/*$!+!3!3C!?J##J/##J$<=s" ##J$<=##DKK0.2kkt{{+u%DK) r   c                 F    d| j                   _        | j                          y ri   )r   rj   r   rb   s     r   start_izReSTStyle.start_i  s    "&r   c                 F    d| j                   _        | j                          y rm   )r   rj   r   r   s    r   end_izReSTStyle.end_i!  s    "'r   c                 h    | j                          d| _        | j                  j                  d       y )NFz* )rT   rL   r   rR   rb   s     r   start_lizReSTStyle.start_li%  s"    	tr   c                 2    d| _         | j                          y ri   )rL   rT   r   s    r   end_lizReSTStyle.end_li*  s    	r   c                     |r<| j                          | j                  j                  |       | j                          y y r   )r   r   r   r   r+   s     r   lizReSTStyle.li.  s.    MMOHHQKKM r   c                     | j                   dk7  r| j                          | xj                   dz  c_         | j                          y r%   rN   r#   r    rb   s     r   start_ulzReSTStyle.start_ul4  s1    ??aKKM1r   c                     | xj                   dz  c_         | j                   dk7  r| j                          | j                          y Nr"   r   rN   r&   r    r   s    r   end_ulzReSTStyle.end_ul:  1    1??aKKMr   c                     | j                   dk7  r| j                          | xj                   dz  c_         | j                          y r%   r   rb   s     r   start_olzReSTStyle.start_ol@  s1    ??aKKM1r   c                     | xj                   dz  c_         | j                   dk7  r| j                          | j                          y r   r   r   s    r   end_olzReSTStyle.end_olG  r   r   c                 &    d| j                   _        y rm   r   r   rb   s     r   start_exampleszReSTStyle.start_examplesM      "r   c                 &    d| j                   _        y ri   r   r   s    r   end_exampleszReSTStyle.end_examplesP      !r   c                 &    d| j                   _        y rm   r   rb   s     r   start_fullnamezReSTStyle.start_fullnameS  r   r   c                 &    d| j                   _        y ri   r   r   s    r   end_fullnamezReSTStyle.end_fullnameV  r   r   c                 z    | j                   j                  d       | j                          | j                          y )Nz::)r   rR   r#   r    rb   s     r   start_codeblockzReSTStyle.start_codeblockY  s'    tr   c                 D    | j                          | j                          y r   r   r   s    r   end_codeblockzReSTStyle.end_codeblock^  r   r   c                 z    | j                          | j                  j                  |       | j                          y)z
        Literal code blocks are introduced by ending a paragraph with
        the special marker ::.  The literal block must be indented
        (and, like all paragraphs, separated from the surrounding
        ones by blank lines).
        N)r   r   r   r   )r   r   s     r   	codeblockzReSTStyle.codeblockb  s.     	r   c                     | j                   j                  dk(  rR| j                   j                  d       | j                   j                  d       | j                   j                  d       y | j                          y )Nr   
.. toctree::
  :maxdepth: 1
z  :titlesonly:

)r   r   rR   r   r   s    r   toctreezReSTStyle.toctreem  sN    88??f$HHNN-.HHNN-.HHNN/0MMOr   c                     | j                   j                  dk(  r| j                  |       y |r| j                   j                  d|z         y | j                   j                  d|z         y )Nmanz  %s)r   r   r   r   )r   item	file_names      r   tocitemzReSTStyle.tocitemu  sM    88??e#GGDM  )!34  $/r   c                     | j                   j                  dk(  rR| j                   j                  d       | j                   j                  d       | j                   j                  d       y y )Nr   r   r   z  :hidden:

r   r   s    r   hidden_toctreezReSTStyle.hidden_toctree~  sJ    88??f$HHNN-.HHNN-.HHNN+, %r   c                 Z    | j                   j                  dk(  r| j                  |       y y )Nr   )r   r   r   )r   r   s     r   hidden_tocitemzReSTStyle.hidden_tocitem  s#    88??f$LL %r   c                     | j                   j                  d       || j                   j                  |       || j                   j                  d|z         y y )Nz.. contents:: z   :depth: %s)r   rR   r   )r   r1   depths      r   table_of_contentszReSTStyle.table_of_contents  sM    '(HHU#HH_u45 r   c                     | j                          | j                  j                  d|z         | j                          | j                          y )Nz.. py:class:: %sr   )r   
class_names     r   start_sphinx_py_classzReSTStyle.start_sphinx_py_class  s9    )J67r   c                 D    | j                          | j                          y r   r   r   s    r   end_sphinx_py_classzReSTStyle.end_sphinx_py_class  r   r   c                     | j                          d|z  }||d|z  z  }| j                  j                  |       | j                          | j                          y )Nz.. py:method:: %sz(%s)r   )r   method_name
parameterscontents       r   start_sphinx_py_methodz ReSTStyle.start_sphinx_py_method  sR    %3!v
**Gwr   c                 D    | j                          | j                          y r   r   r   s    r   end_sphinx_py_methodzReSTStyle.end_sphinx_py_method  r   r   c                     | j                          | j                  j                  d|z         | j                          | j                          y )Nz.. py:attribute:: %sr   )r   	attr_names     r   start_sphinx_py_attrzReSTStyle.start_sphinx_py_attr  s9    -	9:r   c                 D    | j                          | j                          y r   r   r   s    r   end_sphinx_py_attrzReSTStyle.end_sphinx_py_attr  r   r   c                 h    |j                         }|D ]  }| j                  j                  |        y r   )
splitlinesr   r   )r   	docstringdocstring_linesdocstring_lines       r   write_py_doc_stringzReSTStyle.write_py_doc_string  s1    #..0- 	-NHH^,	-r   c                     | j                   j                  dk(  r#| j                   j                  d| d| d       y | j                   j                  |       y )Nr   r   rs   z>`_r   ru   s      r   external_linkzReSTStyle.external_link  sA    88??f$HHNNQugRvS12HHNN5!r   c                     | j                   j                  dk(  r#| j                   j                  d| d| d       y | j                   j                  |       y )Nr   rr   rs   rt   r   )r   r1   pages      r   internal_linkzReSTStyle.internal_link  sA    88??f$HHNNVE7"TF"56HHNN5!r   rB   r   )NN)CrD   rE   rF   r   r    rT   r\   r^   rd   rg   rk   rn   r-   r2   r{   r   r4   r6   r   r   r:   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r	  r  r  r  r*   r   r   rJ   rJ   N   sB   1/
	!3
 55!
'&3!
'0
#"#"
	0-6-
""r   rJ   )logging	getLoggerloggerPUNCTUATION_CHARACTERSr   rJ   r*   r   r   <module>r     s;    			8	$7 6( 6(rq"	 q"r   