ó ÿgdSc@sdZddlZddlZddlZddlZddlZddlmZedƒZ ddl m Z ddl m Z ddlmZddlmZdd lmZdd lmZdd lmZdd lmZejd ejƒZejdejƒZdefd„ƒYZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!defd„ƒYZ"defd„ƒYZ#e j$ƒZ%de&fd„ƒYZ'de&fd„ƒYZ(de j)fd „ƒYZ*d!efd"„ƒYZ+d#„Z,dS($sý sphinx.ext.doctest ~~~~~~~~~~~~~~~~~~ Mimic doctest by automatically executing code snippets and checking their results. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿN(tpathtdoctest(tnodes(t directives(tBuilder(t force_decode(tset_source_info(t Directive(tbold(tbytess^\s*s#\s*doctest:.+$t TestDirectivecBs/eZdZeZdZdZeZd„ZRS(s4 Base class for doctest-related directives. iic Csdj|jƒ}d}|jdkr„d|krN|}tjd|ƒ}ntj|ƒr„|sl|}ntjd|ƒ}q„ntj }|jdks«d|j kr·tj }n|j ròg|j dj d ƒD]}|jƒ^q×}n d g}|||d |jd |ƒ}t||ƒ|dk r?||d tt testsetupt testcleanupthideit,tdefaultt testnodetypetgroupsttestt testoutputtnonetlanguagetoptionst s+-it+(R R (sdoctestR(tjointcontenttNonetnamet blankline_retsubt doctestopt_retsearchRt literal_blockRtcommentt argumentstsplittstripRtreplaceRtOPTIONFLAGS_BY_NAME( tselftcodeRtnodetypetxRtnodetoption_stringstoptiontflag((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pytrun/s@     2        ( t__name__t __module__t__doc__tTruet has_contenttrequired_argumentstoptional_argumentstfinal_argument_whitespaceR1(((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyR %s tTestsetupDirectivecBseZiZRS((R2R3t option_spec(((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyR:YstTestcleanupDirectivecBseZiZRS((R2R3R;(((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyR<\stDoctestDirectivecBs"eZiejd6ejd6ZRS(RR(R2R3RR0t unchangedR;(((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyR=_s tTestcodeDirectivecBseZiejd6ZRS(R(R2R3RR0R;(((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyR?estTestoutputDirectivecBs"eZiejd6ejd6ZRS(RR(R2R3RR0R>R;(((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyR@js t TestGroupcBs&eZd„Zed„Zd„ZRS(cCs(||_g|_g|_g|_dS(N(Rtsetuptteststcleanup(R)R((s</usr/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyt__init__vs   cCs|jdkr>|r+|jjd|ƒq|jj|ƒnÃ|jdkr`|jj|ƒn¡|jdkr…|jj|gƒn||jdkr­|jj|dgƒnT|jdkrõ|jrt|jdƒdkr||jdd | D]6} | |kr±t| ƒ|| s:      4  ì