ó U!¶\c@s·ddlmZdejjjfd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZ d e fd „ƒYZ d e fd „ƒYZ defd„ƒYZ dS(iÿÿÿÿ(tsixtDocStringParsercBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(s§ A simple HTML parser. Focused on converting the subset of HTML that appears in the documentation strings of the JSON models into simple ReST format. cCs,d|_||_tjjjj|ƒdS(N(tNonettreetdocRtmovest html_parsert HTMLParsert__init__(tselfR((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyRs  cCs,tjjjj|ƒt|jƒ|_dS(N(RRRRtresettHTMLTreeRR(R ((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR scCs<tjjjj||ƒ|jjƒt|jƒ|_dS(N( RRRRtfeedRtwriteR R(R tdata((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR s cCs9tjjjj|ƒ|jjƒt|jƒ|_dS(N( RRRRtcloseRR R R(R ((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR&s cCs|jj|d|ƒdS(Ntattrs(Rtadd_tag(R ttagR((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pythandle_starttag,scCs|jj|dtƒdS(Ntis_start(RRtFalse(R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyt handle_endtag/scCs|jj|ƒdS(N(Rtadd_data(R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyt handle_data2s( t__name__t __module__t__doc__RR R RRRR(((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyRs      R cBsAeZdZd„Zded„Zd„Zd„Zd„Z RS(sæ A tree which handles HTML nodes. Designed to work with a python HTML parser, meaning that the current_node will be the most recently opened tag. When a tag is closed, the current_node moves up to the parent node. cCs.||_tƒ|_|j|_g|_dS(N(RtStemNodetheadt current_nodetunhandled_tags(R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR<s   cCs…|j||ƒs&|jj|ƒdS|rr|dkrGt|ƒ}nt||ƒ}|jj|ƒ||_n|jj|_dS(Ntli(t_doc_has_handlerRtappendt LineItemNodetTagNodeRt add_childtparent(R RRRtnode((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyRBs  cCs0|rd|}n d|}t|jj|ƒS(Nsstart_%ssend_%s(thasattrRtstyle(R RRt handler_name((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR!Qs  cCs|jjt|ƒƒdS(N(RR%tDataNode(R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyRYscCs|jj|jƒdS(N(RR R(R ((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR \sN( RRRRRtTrueRR!RR (((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR 6s    tNodecBseZdd„Zd„ZRS(cCs ||_dS(N(R&(R R&((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyRascCs t‚dS(N(tNotImplementedError(R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR dsN(RRRRR (((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR-`s RcBs/eZdd„Zd„Zd„Zd„ZRS(cCs#tt|ƒj|ƒg|_dS(N(tsuperRRtchildren(R R&((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyRiscCs||_|jj|ƒdS(N(R&R0R"(R tchild((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR%ms cCs|j|ƒdS(N(t_write_children(R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR qscCs%x|jD]}|j|ƒq WdS(N(R0R (R RR1((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR2tsN(RRRRR%R R2(((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyRhs   R$cBs8eZdZddd„Zd„Zd„Zd„ZRS(sP A generic Tag node. It will verify that handlers exist before writing. cCs,tt|ƒj|ƒ||_||_dS(N(R/R$RRR(R RRR&((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR}s cCs+|j|ƒ|j|ƒ|j|ƒdS(N(t _write_startR2t _write_end(R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR ‚s  cCs?d|j}t|j|ƒr;t|j|ƒ|jƒndS(Nsstart_%s(RR(R)tgetattrR(R RR*((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR3‡s cCs9d|j}t|j|ƒr5t|j|ƒƒndS(Nsend_%s(RR(R)R5(R RR*((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR4Œs N(RRRRRR R3R4(((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR$ys   R#cBs)eZddd„Zd„Zd„ZRS(cCs tt|ƒjd||ƒdS(NR (R/R#R(R RR&((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR“scCs'|j|ƒtt|ƒj|ƒdS(N(t_lstripR/R#R (R R((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR –s cCsZxS|jD]H}t|tƒr9|jƒ|jrRtSq |j|ƒ}|r tSq WtS(sÆ Traverses the tree, stripping out whitespace until text data is found :param node: The node to strip :return: True if non-whitespace data was found, False otherwise (R0t isinstanceR+tlstripRR,R6R(R R'R1tfound((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR6šs  N(RRRRR R6(((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR#’s R+cBs,eZdZdd„Zd„Zd„ZRS(s0 A Node that contains only string data. cCsNtt|ƒj|ƒt|tjƒsAtdt|ƒƒ‚n||_dS(Ns Expecting string type, %s given.( R/R+RR7Rt string_typest ValueErrorttypeR(R RR&((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR±scCs|jjƒ|_dS(N(RR8(R ((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR8·scCs‰|js dS|jjƒr%d}nS|jdjƒ}|jjƒ}|j|ƒ}dj|ƒ}|rx|d7}n|j|ƒdS(Nt iÿÿÿÿ(Rtisspacetsplitttranslate_wordstjoinR(R Rtstr_datat end_spacetwords((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR ºs   N(RRRRRR8R (((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyR+­s  N( tbotocore.compatRRRRRtobjectR R-RR$R#R+(((sG/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/docstringparser.pyt s&*