1Tc@sdZddlZddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z m Z ddlZddlmZmZddlmZdd lmZdd lmZmZmZmZmZdd lmZmZdd lmZm Z m!Z!dd l"m#Z#ddl$m%Z%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.m/Z/m0Z0i dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6Z1d)Z2d*Z3d+e4fd,YZ5d-e4fd.YZ6dS(/s sphinx.application ~~~~~~~~~~~~~~~~~~ Sphinx application object. Gracefully adapted from the TextPress system by Armin. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iN(tpath(tStringIO(tnodes(tconvert_directive_functiont directivestroles(t package_dirtlocale(tXRefRole(tConfig(t SphinxErrort SphinxWarningtExtensionErrortVersionRequirementErrort ConfigError(tObjTypetBUILTIN_DOMAINS(t GenericObjecttTargettStandardDomain(tBUILTIN_BUILDERS(tBuildEnvironmenttSphinxStandaloneReader(tpycompat(tTags(tENOENT(tboldt lightgraytdarkgraytsbuilder-initedsenv, added, changed, removedsenv-get-outdateds env, docnames env-purge-docsdocname, source texts source-reads the doctree before being pickleds doctree-readsenv, node, contnodesmissing-referencesdoctree, docnamesdoctree-resolvedtenvs env-updatedtbuildershtml-collect-pagess"pagename, context, doctree or Noneshtml-page-contextt exceptionsbuild-finishedsconf.pysenvironment.pickletSphinxc BseZd,ejejeed,dddZdZdZ dZ ed,dZ edZ d,ddZ d ed Zd Zd Zd ZdZdZd,dZdZdZdZdZdZdZdZdZdZd,d,dZd,d,dZdZ dZ!dZ"dZ#d,d,d Z$d!Z%d"Z&d d,d,d gd#Z'e'Z(d d,d d$Z)d%Z*d&Z+d'Z,d(Z-d)Z.d*Z/d+Z0RS(-icCso| |_d|_i|_i|_tj|_tj|_d|_ d|_ ||_ ||_ ||_||_| |_|dkrt|_t|_n||_t|_|dkrt|_n ||_d|_| |_tj|_|jtdtjd|_t | |_!t"|t#|p@i|j!|_$|j$j%|j&|j dkr|j |_ n|j'dx!|j$j(D]}|j'|qW|j$j)rt*|j$j)dr|j$j)|qt+dddn|j$j,|j$j-rG|j$j-tjd krGt.d |j$j-n|j/|j0| |j1|dS( NisRunning Sphinx v%sssphinx.ext.oldcmarkupt__call__s6'setup' that is specified in the conf.py has not been s5callable. Please provide a callable `setup` function s8in order to behave as a sphinx extension conf.py itself.isWThis project needs at least Sphinx v%s and therefore cannot be built with this version.(2t verbositytnext_listener_idt _extensionst _listenersRtcopytdomainsRtbuilderclassestNoneRRtsrcdirtconfdirtoutdirt doctreedirtparallelRt_statustTruetquiettFalset_warningt _warncounttwarningiserrorteventst_eventstinfoRtsphinxt __version__t statuscodeRttagsR tCONFIG_FILENAMEtconfigt check_unicodetwarntsetup_extensiont extensionstsetupthasattrRt init_valuest needs_sphinxR t _init_i18nt _init_envt _init_builder(tselfR+R,R-R.t buildernamet confoverrideststatustwarningtfreshenvR6R=R#R/t extension((s</usr/local/lib/python2.7/site-packages/sphinx/application.pyt__init__>sd                             cCs|jjdk r||jtd|jjdtdtjtdgg|jj D]}tj|j |^qW}ng}t j ||jj\|_ }|jjdk r|s|jjdkr|jdq|jdndS(shLoad translated strings from the configured localedirs if enabled in the configuration. sloading translations [%s]... tnonlRtentdones#not available for built-in messagesN(R?tlanguageR*R9RR1RtjoinRt locale_dirsR+Rtinitt translator(RKtxRXthas_translation((s</usr/local/lib/python2.7/site-packages/sphinx/application.pyRHs 2 cCs|rtt|j|j|j|_|jj|jx6|jjD]&}|j||j|jj|Emit a verbose informational message. The message will only be emitted for verbosity levels >= 1 (i.e. at least one ``-v`` option was given). The message can contain %-style interpolation placeholders, which is formatted with either the ``*args`` or ``**kwargs`` when output. iN(R#RR0(RKRtargstkwargs((s</usr/local/lib/python2.7/site-packages/sphinx/application.pytverboses  cOsO|jdkrdS|s|r2||p+|}n|jt||jdS(sDEmit a debug-level informational message. The message will only be emitted for verbosity levels >= 2 (i.e. at least two ``-v`` options were given). The message can contain %-style interpolation placeholders, which is formatted with either the ``*args`` or ``**kwargs`` when output. iN(R#RRR0(RKRRR((s</usr/local/lib/python2.7/site-packages/sphinx/application.pytdebug's  cOsO|jdkrdS|s|r2||p+|}n|jt||jdS(sBEmit a lowlevel debug-level informational message. The message will only be emitted for verbosity level 3 (i.e. three ``-v`` options were given). The message can contain %-style interpolation placeholders, which is formatted with either the ``*args`` or ``**kwargs`` when output. iN(R#RRR0(RKRRR((s</usr/local/lib/python2.7/site-packages/sphinx/application.pytdebug26s  cCs|jd|||jkr#dSyt|dddg}Wn&tk rg}td||nXt|ds|jd|n=y|j|Wn)t k r}t d||fnX||j||jd|x'|jjD]}|j|dq WdS(Ns"[app] disconnecting event: [id=%s](RR&t itervaluestpopR*(RKRR((s</usr/local/lib/python2.7/site-packages/sphinx/application.pyt disconnectscGsy!|jd|t|d Wntk r4nXg}||jkrx:|j|jD]"\}}|j|||q^Wn|S(Ns[app] emitting event: %r%sid(RtreprRaR&t iteritemstappend(RKRRtresultst_R((s</usr/local/lib/python2.7/site-packages/sphinx/application.pyRms!  cGs1x*|j||D]}|dk r|SqWdS(N(RmR*(RKRRtresult((s</usr/local/lib/python2.7/site-packages/sphinx/application.pytemit_firstresults cCs|jd|t|ds2td|n|j|jkrt|j|jtrstd|jqtd|j|j|jjfn||j|jtd|n|ttfkre|r\dp_d}n||f|jj|R`RR!R(((s</usr/local/lib/python2.7/site-packages/sphinx/application.pyt sN     ( 4