ó V!¶\c@sĢdZdZddlZddlZddlZddlZddlmZm Z m Z m Z ddl m Z mZddl mZddlmZmZddlmZmZmZdd lmZmZdd lmZdd lmZd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!defd„ƒYZ"defd„ƒYZ#defd„ƒYZ$defd„ƒYZ%defd„ƒYZ&dS( sMiscellaneous directives.treStructuredTexti’’’’N(tiotnodest statemachinetutils(t SafeStringt ErrorString(tlocale_encoding(t Directivetconvert_directive_function(t directivestroleststates(t CodeBlockt NumberLines(t set_classes(tmisctIncludecBsøeZdZdZdZeZi ejd6ej d6ej d6e d6e d6e d6ej d 6ej d 6ej d 6ej d 6ej d 6ZejjejjejƒdƒZd„ZRS(s] Include content read from a separate source file. Content may be parsed by the parser, or included as a literal block. The encoding of the included file can be specified. Only a part of the given file argument may be included by specifying start and end line or text to match before and/or after the text to be used. iitliteraltcodetencodings tab-widths start-linesend-lines start-afters end-befores number-linestclasstnametincludec Cs…|jjjjs+|jd|jƒ‚n|jjj|j |jj dƒ}t j j t j j|ƒƒ}tj |jdƒ}|jdƒrÅ|jdƒrÅt j j|j|dd!ƒ}nt j jt j j||ƒƒ}tjd|ƒ}tj|ƒ}|jjd|jjjjƒ}|jjjj}|jjd|jjjjƒ}y;|jjjj j!|ƒt"j#d |d|d |ƒ}Wnit$k rĶ}|j%d |jt&|ƒfƒ‚n5t'k r}|j%d |jt(|ƒfƒ‚nX|jjd dƒ} |jjddƒ} yG| sA| dk rf|j)ƒ} dj| | | !ƒ} n |j*ƒ} Wn5t+k rŖ}|j%d|jt(|ƒfƒ‚nX|jjddƒ} | r| j,| ƒ}|dkrś|j%d|jƒ‚n| |t-| ƒ} n|jjddƒ}|rm| j,|ƒ}|dkr`|j%d|jƒ‚n| | } nt.j/| |dt0ƒ}d|jkr|dkr²| j1|ƒ}n| }tj2| d|d|jjdgƒƒ}d|_3|j4|ƒd|jkrćyt5|jdpdƒ} Wn t6k rF|j7dƒ‚nX| t-|ƒ} |jdƒrs|d }nt8g|fg| | ƒ}xh|D]G\}}|rĘ|tj9||d|ƒ7}q•|tj:||ƒ7}q•Wn|tj:||ƒ7}|gSd|jkrn||jd|j|jƒ }|j?ƒS|jj@||ƒgS(s8Include a file as part of the content of this reST file.s"%s" directive disabled.iiti’’’’Rs tab-widtht source_patht error_handleruVProblems with "%s" directive path: Cannot encode input file path "%s" (wrong locale?).u&Problems with "%s" directive path: %s.s start-linesend-linetuProblem with "%s" directive: %ss start-aftersDProblem with "start-after" option of "%s" directive: Text not found.s end-beforesCProblem with "end-before" option of "%s" directive: Text not found.tconvert_whitespaceRtsourcetclassesRs number-liness+:number-lines: with non-integer start values RN(Atstatetdocumenttsettingstfile_insertion_enabledtwarningRt state_machinet input_linesRtlinenot input_offsettostpathtdirnametabspathR t argumentst startswithtendswithtjointstandard_include_pathtnormpathRt relative_pathtNoneRt reprunicodetoptionstgettinput_encodingtinput_encoding_error_handlert tab_widthtrecord_dependenciestaddRt FileInputtUnicodeEncodeErrortsevereRtIOErrorRt readlinestreadt UnicodeErrortfindtlenRt string2linestTruet expandtabst literal_blocktlinetadd_nametintt ValueErrorterrorRtinlinetTextR tpoptcontent_offsett block_texttrunt insert_input(tselfRt source_dirR*Rt e_handlerR:t include_fileRNt startlinetendlinetlinestrawtextt after_textt after_indext before_textt before_indext include_linesttextRIttokensRtvaluet codeblock((sH/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/misc.pyRT5s¶ "!                       (t__name__t __module__t__doc__trequired_argumentstoptional_argumentsRGtfinal_argument_whitespaceR tflagt unchangedRRLtunchanged_requiredt class_optiont option_specR)R*R0R+R t__file__R1RT(((sH/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/misc.pyRs$          tRawcBsSeZdZdZdZeZiejd6ej d6ej d6Z eZ d„Z RS(sÉ Pass through content unchanged Content is included in output based on type argument Content may be included inline (content section of directive) or imported from a file or url. iitfileturlRc Cs½|jjjj sD|jjjj r]d|jksDd|jkr]|jd|jƒ‚nidj|j dj ƒj ƒƒd6}|jj d|jjjj ƒ}|jjjj}|jrd|jksąd|jkrł|jd|jƒ‚nd j|jƒ}nrd|jkrnd|jkrE|jd |jƒ‚ntjjtjj|jjjƒƒ}tjjtjj||jdƒƒ}tjd|ƒ}y;tjd |d|d |ƒ}|jjjjj|ƒWn5tk r}|jd |jt |ƒfƒ‚nXy|j!ƒ}Wn5t"k r`}|jd|jt |ƒfƒ‚nX||dR$ttimetstrftimetdecodetUnicodeDecodeErrorRRP(RVt format_strRc((sH/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/misc.pyRTŌs(    (RgRhRGRŠRT(((sH/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/misc.pyRŹŠst TestDirectivecBs9eZdZdZeZiejd6ZeZ d„Z RS(s3This directive is useful only for testing purposes.itoptioncCsœ|jradj|jƒ}|jjjd|j|j|jftj ||ƒd|j ƒ}n4|jjjd|j|j|jfd|j ƒ}|gS(Ns sBDirective processed. Type="%s", arguments=%r, options=%r, content:RJsGDirective processed. Type="%s", arguments=%r, options=%r, content: None( R{R0R%R”tinfoRR-R6RRIR'(RVRcRÖ((sH/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/misc.pyRTs  !  ( RgRhRiRkRGRlR RoRqRŠRT(((sH/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/misc.pyRŌžs ('Rit __docformat__RĢtos.pathR)R£RĻtdocutilsRRRRtdocutils.utils.error_reportingRRRtdocutils.parsers.rstRR R R R t$docutils.parsers.rst.directives.bodyR Rtdocutils.parsers.rst.rolesRtdocutils.transformsRRRsR‹RšR„R®RÄRČRŹRŌ(((sH/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/misc.pyts.    "‹Z ,&= .