ó U!¶\c@s{ddlZddlmZddlmZddlmZejdƒZde fd„ƒYZ de fd „ƒYZ dS( iÿÿÿÿN(t OrderedDict(tDocStringParser(t ReSTStyletbcdocst ReSTDocumentcBsweZdd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z RS( tmancCsat|ƒ|_||_t|ƒ|_t|_t|_i|_ i|_ g|_ d|_ dS(N(RtstylettargetRtparsertTruet keep_datatFalsetdo_translationttranslation_mapthrefst_writestNonet_last_doc_string(tselfR((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt__init__s      cCs,|jr(|dk r(|jj|ƒndS(N(R RRtappend(Rts((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt_write#scCs|j|ƒdS(s2 Write content into the document. N(R(Rtcontent((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytwrite'scCs$|jd|jjƒ|fƒdS(s- Write content on a newline. s%s%s N(RRtspaces(RR((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytwriteln-scCs |jdS(sn Returns the last content written to the document without removing it from the stack. iÿÿÿÿ(R(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt peek_write3scCs |jjƒS(sL Removes and returns the last content written to the stack. (Rtpop(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt pop_write:scCs|jj|ƒdS(s2 Places new content on the stack. N(RR(RR((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt push_write@scCse|jrL|jjƒx3|jjƒD]\}}|jj||ƒq&Wndj|jƒjdƒS(sJ Returns the current content of the document as a string. tsutf-8(RRt new_paragraphtitemstlink_target_definitiontjoinRtencode(Rtrefnametlink((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytgetvalueFs   cCs&g|D]}|jj||ƒ^qS(N(R tget(Rtwordstw((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyttranslate_wordsPscCs#|r|jr|j|ƒndS(N(R R(Rtdata((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt handle_dataSscCs|r‹yNt|jƒ}|jj|ƒ|jjƒt|jƒ}||f|_Wq‹tk r‡tjddt ƒtj|ƒq‹XndS(NsError parsing doc stringtexc_info( tlenRRtfeedtcloseRt ExceptiontLOGtdebugR (Rt doc_stringtstarttend((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytinclude_doc_stringWs  cCs2|jdk r.|j\}}|j||5ndS(N(RRR(RR6R7((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytremove_last_doc_stringcs(t__name__t __module__RRRRRRRR'R+R-R8R9(((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRs         tDocumentStructurecBs³eZdddd„Zed„ƒZed„ƒZejd„ƒZed„ƒZed„ƒZ d„Z dd„Z d „Z d „Z d „Zd „Zd „Zd„ZRS(RcCs~tt|ƒjd|ƒ||_tƒ|_|jg|_i|_|dk r^||_n|dk rz|j |ƒndS(s5Provides a Hierarichial structure to a ReSTDocument You can write to it similiar to as you can to a ReSTDocument but has an innate structure for more orginaztion and abstraction. :param name: The name of the document :param section_names: A list of sections to be included in the document. :param target: The target documentation of the Document structure :param context: A dictionary of data to store with the strucuture. These are only stored per section not the entire structure. RN( tsuperR<Rt_nameRt _structuret_patht_contextRt_generate_structure(Rtnamet section_namesRtcontext((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRks       cCs|jS(s"The name of the document structure(R>(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRC‚scCs|jS(sv A list of where to find a particular document structure in the overlying document structure. (R@(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytpath‡scCs ||_dS(N(R@(Rtvalue((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRFscCs t|jƒS(N(tlistR?(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytavailable_sections“scCs|jS(N(RA(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRE—scCs"x|D]}|j|ƒqWdS(N(tadd_new_section(RRDt section_name((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRB›s cCso|jd|d|jd|ƒ}|j|g|_|jj|j_|j|_|j|_||j|<|S(sAdds a new section to the current document structure This document structure will be considered a section to the current document structure but will in itself be an entirely new document structure that can be written to and have sections as well :param name: The name of the section. :param context: A dictionary of data to store with the strucuture. These are only stored per section not the entire structure. :rtype: DocumentStructure :returns: A new document structure to add to but lives as a section to the document structure it was instantiated from. RCRRE(t __class__RRFRt indentationR RR?(RRCREtsection((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRJŸs    cCs |j|S(sRetrieve a section(R?(RRC((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt get_section¹scCs|j|=dS(sDelete a sectionN(R?(RRC((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytdelete_section½scCs¤t|jƒdkrd|jrd|jjƒx3|jjƒD]\}}|jj||ƒq;Wqdn|jƒ}x-|jjƒD]\}}||j ƒ7}q€W|S(sÍFlushes a doc structure to a ReSTructed string The document is flushed out in a DFS style where sections and their subsections' values are added to the string as they are visited. i( R/RFRRR R!R"R'R?tflush_structure(RR%R&RGRCRN((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyRQÁs   cCsdj|jƒjdƒS(NRsutf-8(R#RR$(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyR'ÓscCstƒ|_dS(N(RR?(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pytremove_all_sectionsÖscCs g|_dS(N(R(R((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt clear_textÙsN(R:R;RRtpropertyRCRFtsetterRIRERBRJRORPRQR'RRRS(((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyR<js       ( tloggingtbotocore.compatRt#botocore.docs.bcdoc.docstringparserRtbotocore.docs.bcdoc.styleRt getLoggerR3tobjectRR<(((s?/tmp/pip-install-usGedi/botocore/botocore/docs/bcdoc/restdoc.pyt s T