
    \3                     ^    S SK r \ R                  " S5      rSr " S S5      r " S S\5      rg)    Nbcdocs).,?!:;c                       \ rS rSrSS jr\S 5       r\R                  S 5       rS rS r	S r
S rS	 rSS jrS rS rS rS rS rSrg
)	BaseStyle   c                 8    Xl         X l        SU l        SU l        g )Nr   T)docindent_width_indent	keep_dataselfr   r   s      ,lib/third_party/botocore/docs/bcdoc/style.py__init__BaseStyle.__init__   s    (    c                     U R                   $ Nr   r   s    r   indentationBaseStyle.indentation   s    ||r   c                     Xl         g r   r   )r   values     r   r   r       s    r   c                 (    SU R                  5       -  $ Nz
%s)spacesr   s    r   new_paragraphBaseStyle.new_paragraph$   s    %%r   c                 .    U =R                   S-  sl         g )N   r   r   s    r   indentBaseStyle.indent'   s    r   c                 P    U R                   S:  a  U =R                   S-  sl         g g Nr   r&   r   r   s    r   dedentBaseStyle.dedent*   s!    <<!LLAL r   c                 :    SU R                   U R                  -  -  $ )N )r   r   r   s    r   r"   BaseStyle.spaces.   s    dllT%6%6677r   c                     U$ r    r   ss     r   boldBaseStyle.bold1       r   Nc                     U$ r   r1   )r   linktitles      r   refBaseStyle.ref4   s    r   c                     U$ r   r1   r2   s     r   h2BaseStyle.h27   r6   r   c                     U$ r   r1   r2   s     r   h3BaseStyle.h3:   r6   r   c                     U$ r   r1   r2   s     r   	underlineBaseStyle.underline=   r6   r   c                     U$ r   r1   r2   s     r   italicsBaseStyle.italics@   r6   r   c                     U R                   R                  5       nUc  SnUS:w  a  US   S:w  a  US-  nU R                   R                  U5        g )N r.   )r   	pop_write
push_write)r   
last_writes     r   $add_trailing_space_to_previous_write.BaseStyle.add_trailing_space_to_previous_writeC   sP     XX'')
J
2# 5#JJ'r   )r   r   r   r      r   )__name__
__module____qualname____firstlineno__r   propertyr   setterr#   r'   r+   r"   r4   r:   r=   r@   rC   rF   rN   __static_attributes__r1   r   r   r   r      sl        &8(r   r   c                      \ rS rSrSDS jrS rS rS rS rSES jr	S	 r
SES
 jrS rS rSES jrS rS rS rS rSES jrS rS rSES jrS rSES jrS rS rSES jrS rSES jrS rSES jrS r SES  jr!S! r"SES" jr#S# r$SES$ jr%SES% jr&S& r'SES' jr(S( r)S) r*SES* jr+S+ r,SES, jr-S- r.SES. jr/S/ r0SES0 jr1S1 r2SES2 jr3S3 r4S4 r5S5 r6SES6 jr7S7 r8S8 r9SFS9 jr:S: r;S; r<SES< jr=S= r>S> r?S? r@S@ rASA rBSB rCSCrDg)G	ReSTStyleN   c                 Z    [         R                  XU5        SU l        S U l        SU l        g )NTr   )r   r   do_pa_href
list_depthr   s      r   r   ReSTStyle.__init__O   s'    4l3	r   c                 \    U R                   R                  SU R                  5       -  5        g Nz

%sr   writer"   r   s    r   r#   ReSTStyle.new_paragraphU   s    x$++-/0r   c                 \    U R                   R                  SU R                  5       -  5        g r!   rc   r   s    r   new_lineReSTStyle.new_lineX   s    v-.r   c                      U R                   R                  5       nUS;   a!  US;   a  U R                   R                  S5        U R                   R                  U5        g ! [         a     N(f = f)N)***r.   )r   
peek_writerd   
IndexErrorr   markuprM   s      r   _start_inlineReSTStyle._start_inline[   s^    	$,,.J [(V{-Bs#v  		s   A 
A,+A,c                     U R                   R                  5       nX!:X  a  g U R                   R                  U5        U R                   R                  U5        g r   )r   rK   rL   rd   rn   s      r   _end_inlineReSTStyle._end_inlineg   sA    
 XX'')
J'vr   Nc                 &    U R                  S5        g Nrk   rp   r   attrss     r   
start_boldReSTStyle.start_boldr   s    4 r   c                 &    U R                  S5        g rv   rs   r   s    r   end_boldReSTStyle.end_boldu   s    r   c                 H    SU R                   l        U R                  U5        g NT)r   do_translationrz   rx   s     r   start_bReSTStyle.start_bx   s    "&r   c                 F    SU R                   l        U R                  5         g NF)r   r   r~   r   s    r   end_bReSTStyle.end_b|   s    "'r   c                     U(       a<  U R                  5         U R                  R                  U5        U R                  5         g g r   )rz   r   rd   r~   r2   s     r   r4   ReSTStyle.bold   -    OOHHNN1MMO r   c                 R    Uc  UnU R                   R                  SU SU S35        g )N:doc:` <>`)r   rd   r   r9   r8   s      r   r:   ReSTStyle.ref   s+    <Dwbb12r   c                     U[        U5      -  nU R                  5         U R                  R                  U SU SU 35        U R                  5         g )N
)lenr#   r   rd   )r   r3   border_charborders       r   _headingReSTStyle._heading   sI    s1v%&A3b12r   c                 (    U R                  US5        g Nrj   r   r2   s     r   h1ReSTStyle.h1       ar   c                 (    U R                  US5        g )N=r   r2   s     r   r=   ReSTStyle.h2   r   r   c                 (    U R                  US5        g )N-r   r2   s     r   r@   ReSTStyle.h3   r   r   c                 &    U R                  S5        g r   rw   rx   s     r   start_italicsReSTStyle.start_italics   s    3r   c                 &    U R                  S5        g r   r}   r   s    r   end_italicsReSTStyle.end_italics   s    r   c                     U(       a<  U R                  5         U R                  R                  U5        U R                  5         g g r   )r   r   rd   r   r2   s     r   rF   ReSTStyle.italics   s2     HHNN1 r   c                     U R                   (       a-  U R                  R                  SU R                  5       -  5        g g rb   r]   r   rd   r"   rx   s     r   start_pReSTStyle.start_p   )    99HHNN8dkkm34 r   c                     U R                   (       a-  U R                  R                  SU R                  5       -  5        g g rb   r   r   s    r   end_pReSTStyle.end_p   r   r   c                 h    SU R                   l        U R                  5         U R                  S5        g )NT``)r   r   rN   rp   rx   s     r   
start_codeReSTStyle.start_code   s(    "&1134 r   c                 H    SU R                   l        U R                  S5        g )NFr   )r   r   rs   r   s    r   end_codeReSTStyle.end_code   s    "'r   c                     U(       a<  U R                  5         U R                  R                  U5        U R                  5         g g r   )r   r   rd   r   r2   s     r   codeReSTStyle.code   r   r   c                     U R                  5         U R                  R                  S5        U R                  5         U R                  5         g )Nz	.. note::r#   r   rd   r'   rx   s     r   
start_noteReSTStyle.start_note   s3    {#r   c                 D    U R                  5         U R                  5         g r   r+   r#   r   s    r   end_noteReSTStyle.end_note       r   c                     U R                  5         U R                  R                  S5        U R                  5         U R                  5         g )Nz.. warning::r   rx   s     r   start_importantReSTStyle.start_important   s3    ~&r   c                 D    U R                  5         U R                  5         g r   r   r   s    r   end_importantReSTStyle.end_important   r   r   c                     U R                  5         U R                  R                  S5        U R                  5         U R                  5         g )Nz.. danger::r   rx   s     r   start_dangerReSTStyle.start_danger   s3    }%r   c                 D    U R                  5         U R                  5         g r   r   r   s    r   
end_dangerReSTStyle.end_danger   r   r   c                    U R                  5         U(       aD  U H=  u  p#US:X  d  M  UR                  5       U l        U R                  R	                  S5        M?     OU R                  R	                  S5        SU R                  l        g )Nhref`r.   T)rN   stripr^   r   rd   r   )r   ry   attr_key
attr_values       r   start_aReSTStyle.start_a   sh     	113(-$v% #-"2"2"4DKHHNN3' ). HHNN3"&r   c                 F    U R                   R                  SU SU 35        g )Nz.. _z: )r   writeln)r   refnamer8   s      r   link_target_definition ReSTStyle.link_target_definition   s!    4y4&12r   c                     Uc  UnU R                   R                  S:X  a#  U R                   R                  SU SU S35        g U R                   R                  U5        g )Nhtmlz:ref:`r   r   r   targetrd   )r   labeltexts      r   sphinx_reference_label ReSTStyle.sphinx_reference_label   sK    <D88??f$HHNNVD6E7"56HHNN4 r   c                 H   U R                   nUR                  5       nUR                  S5      (       d+  UR                  5       U-   nUR                  S5      (       d  M+  US:w  a?  UR                  S5      (       a  SUSS  R                  S5       3nUR	                  U5        g g )Nr   rI   z` r&   r.   )r   rK   
startswithlstriprL   )r   r   rM   s      r   _clean_link_textReSTStyle._clean_link_text   s    hh]]_
'',,:5J '',,$$T** AB!6!6s!; <=
NN:&	 r   c                    SU R                   l        U R                  (       GaH  U R                  5         U R                   R	                  5       nUR                  S5      nU(       ab  US:w  a\  SU;   a  UR                  SS5      nU R                   R                  U5        U R                   R                  SU R                  -  5        OUS:X  a)  U R                   R                  SU R                  -  5        OmU R                   R                  U R                  5        U R                  U R                   R                  U R                  '   U R                   R                  S5        S U l        g g )	NFr.   r   r   z\:z <%s>`__z`<%s>`__z`__)
r   r   r^   r   rK   rstripreplacerL   hrefsrd   )r   
next_childrM   s      r   end_aReSTStyle.end_a  s   "';;;!!#++-J#**3/JjC/*$!+!3!3C!?J##J/##J$<=s" ##J$<=##DKK0.2kkt{{+u%DK) r   c                 F    SU R                   l        U R                  5         g r   )r   r   r   rx   s     r   start_iReSTStyle.start_i  s    "&r   c                 F    SU R                   l        U R                  5         g r   )r   r   r   r   s    r   end_iReSTStyle.end_i!  s    "'r   c                 h    U R                  5         SU l        U R                  R                  S5        g )NFz* )rg   r]   r   rd   rx   s     r   start_liReSTStyle.start_li%  s"    	tr   c                 2    SU l         U R                  5         g r   )r]   rg   r   s    r   end_liReSTStyle.end_li*  s    	r   c                     U(       a<  U R                  5         U R                  R                  U5        U R                  5         g g r   )r   r   r   r   r2   s     r   liReSTStyle.li.  s.    MMOHHQKKM r   c                     U R                   S:w  a  U R                  5         U =R                   S-  sl         U R                  5         g r*   r_   r'   r#   rx   s     r   start_ulReSTStyle.start_ul4  s1    ??aKKM1r   c                     U =R                   S-  sl         U R                   S:w  a  U R                  5         U R                  5         g Nr&   r   r_   r+   r#   r   s    r   end_ulReSTStyle.end_ul:  1    1??aKKMr   c                     U R                   S:w  a  U R                  5         U =R                   S-  sl         U R                  5         g r*   r  rx   s     r   start_olReSTStyle.start_ol@  s1    ??aKKM1r   c                     U =R                   S-  sl         U R                   S:w  a  U R                  5         U R                  5         g r	  r
  r   s    r   end_olReSTStyle.end_olG  r  r   c                 &    SU R                   l        g r   r   r   rx   s     r   start_examplesReSTStyle.start_examplesM      "r   c                 &    SU R                   l        g r   r  r   s    r   end_examplesReSTStyle.end_examplesP      !r   c                 &    SU R                   l        g r   r  rx   s     r   start_fullnameReSTStyle.start_fullnameS  r  r   c                 &    SU R                   l        g r   r  r   s    r   end_fullnameReSTStyle.end_fullnameV  r  r   c                 z    U R                   R                  S5        U R                  5         U R                  5         g )Nz::)r   rd   r'   r#   rx   s     r   start_codeblockReSTStyle.start_codeblockY  s'    tr   c                 D    U R                  5         U R                  5         g r   r   r   s    r   end_codeblockReSTStyle.end_codeblock^  r   r   c                 z    U R                  5         U R                  R                  U5        U R                  5         g)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   	codeblockReSTStyle.codeblockb  s.     	r   c                     U R                   R                  S:X  aR  U R                   R                  S5        U R                   R                  S5        U R                   R                  S5        g U R                  5         g )Nr   
.. toctree::
  :maxdepth: 1
z  :titlesonly:

)r   r   rd   r  r   s    r   toctreeReSTStyle.toctreem  sN    88??f$HHNN-.HHNN-.HHNN/0MMOr   c                     U R                   R                  S:X  a  U R                  U5        g U(       a  U R                   R                  SU-  5        g U R                   R                  SU-  5        g )Nmanz  %s)r   r   r  r   )r   item	file_names      r   tocitemReSTStyle.tocitemu  sM    88??e#GGDM  )!34  $/r   c                     U R                   R                  S:X  aR  U R                   R                  S5        U R                   R                  S5        U R                   R                  S5        g g )Nr   r-  r.  z  :hidden:

r   r   s    r   hidden_toctreeReSTStyle.hidden_toctree~  sJ    88??f$HHNN-.HHNN-.HHNN+, %r   c                 \    U R                   R                  S:X  a  U R                  U5        g g )Nr   )r   r   r5  )r   r3  s     r   hidden_tocitemReSTStyle.hidden_tocitem  s#    88??f$LL %r   c                     U R                   R                  S5        Ub  U R                   R                  U5        Ub  U R                   R                  SU-  5        g g )Nz.. contents:: z   :depth: %s)r   rd   r   )r   r9   depths      r   table_of_contentsReSTStyle.table_of_contents  sM    '(HHU#HH_u45 r   c                     U R                  5         U R                  R                  SU-  5        U R                  5         U R                  5         g )Nz.. py:class:: %sr   )r   
class_names     r   start_sphinx_py_classReSTStyle.start_sphinx_py_class  s9    )J67r   c                 D    U R                  5         U R                  5         g r   r   r   s    r   end_sphinx_py_classReSTStyle.end_sphinx_py_class  r   r   c                     U R                  5         SU-  nUb  USU-  -  nU R                  R                  U5        U R                  5         U R                  5         g )Nz.. py:method:: %sz(%s)r   )r   method_name
parameterscontents       r   start_sphinx_py_method ReSTStyle.start_sphinx_py_method  sR    %3!v
**Gwr   c                 D    U R                  5         U R                  5         g r   r   r   s    r   end_sphinx_py_methodReSTStyle.end_sphinx_py_method  r   r   c                     U R                  5         U R                  R                  SU-  5        U R                  5         U R                  5         g )Nz.. py:attribute:: %sr   )r   	attr_names     r   start_sphinx_py_attrReSTStyle.start_sphinx_py_attr  s9    -	9:r   c                 D    U R                  5         U R                  5         g r   r   r   s    r   end_sphinx_py_attrReSTStyle.end_sphinx_py_attr  r   r   c                 l    UR                  5       nU H  nU R                  R                  U5        M      g r   )
splitlinesr   r   )r   	docstringdocstring_linesdocstring_lines       r   write_py_doc_stringReSTStyle.write_py_doc_string  s,    #..0-NHH^, .r   c                     U R                   R                  S:X  a#  U R                   R                  SU SU S35        g U R                   R                  U5        g )Nr   r   r   z>`_r   r   s      r   external_linkReSTStyle.external_link  sA    88??f$HHNNQugRvS12HHNN5!r   c                     U R                   R                  S:X  a#  U R                   R                  SU SU S35        g U R                   R                  U5        g )Nr   r   r   r   r   )r   r9   pages      r   internal_linkReSTStyle.internal_link  sA    88??f$HHNNVE7"TF"56HHNN5!r   )r^   r]   r_   rP   r   )NN)ErR   rS   rT   rU   r   r#   rg   rp   rs   rz   r~   r   r   r4   r:   r   r   r=   r@   r   r   rF   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/  r5  r8  r;  r?  rC  rF  rL  rO  rS  rV  r]  r`  rd  rX   r1   r   r   rZ   rZ   N   sB   1/
	!3
 55!
'&3!
'0
#"#"
	0-6-
""r   rZ   )logging	getLoggerloggerPUNCTUATION_CHARACTERSr   rZ   r1   r   r   <module>rj     s9    			8	$7 6( 6(rq"	 q"r   