3
T'ícã× ã 5 @ sX d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZmZm
Z
mZmZmZmZmZmZmZ ddlmZ ddlmZmZ dd lmZ dd
lmZmZ ddlm Z ddl!m"Z" ddl#Z#dd
l#m$Z$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZD ddlEmZmFZFmGZG ddlHmIZI ddlJmKZK ddlLmMZM dd lNmOZO dd!lPmQZQmRZRmSZS dd"lTmUZU dd#lVmWZWmXZX er&dd$lmYZY dd%lZm[Z[ d`Z\d[Z]eFj^e_Z`G d\d] d]ZaG d^d_ d_ZbdS )aznSphinx application class and extensibility interface.
Gracefully adapted from the TextPress system by Armin.
é N)Údeque)ÚStringIO)Úpath)
ÚIOÚ
TYPE_CHECKINGÚAnyÚCallableÚDictÚListÚOptionalÚTupleÚTypeÚUnion)Únodes)ÚElementÚTextElement)ÚParser)Ú DirectiveÚroles)Ú Transform)ÚLexer)ÚlocaleÚpackage_dir)ÚConfig)ÚRemovedInSphinx60Warning)ÚDomainÚIndex)ÚBuildEnvironment)ÚEnvironmentCollector)ÚApplicationErrorÚConfigErrorÚVersionRequirementError)ÚEventManager)Ú Extension)Ú
lexer_classes)Ú__)ÚProject)ÚSphinxComponentRegistry)ÚXRefRole)ÚTheme)ÚdocutilsÚloggingÚprogress_message)Ú
BuildPhase)Úbold)ÚCatalogRepository)Úprefixed_warnings)ÚabspathÚ ensuredirÚrelpath)ÚTags)ÚRoleFunctionÚTitleGetter)ÚNode)ÚBuilderúsphinx.addnodesúsphinx.builders.changesúsphinx.builders.epub3úsphinx.builders.dirhtmlúsphinx.builders.dummyúsphinx.builders.gettextúsphinx.builders.htmlúsphinx.builders.latexúsphinx.builders.linkcheckúsphinx.builders.manpageúsphinx.builders.singlehtmlúsphinx.builders.texinfoúsphinx.builders.textúsphinx.builders.xmlú
sphinx.configúsphinx.domains.cúsphinx.domains.changesetúsphinx.domains.citationúsphinx.domains.cppúsphinx.domains.indexúsphinx.domains.javascriptúsphinx.domains.mathúsphinx.domains.pythonúsphinx.domains.rstúsphinx.domains.stdúsphinx.directivesúsphinx.directives.codeúsphinx.directives.otherúsphinx.directives.patchesúsphinx.extensionúsphinx.parsersúsphinx.registryúsphinx.rolesúsphinx.transformsú%sphinx.transforms.compact_bullet_listúsphinx.transforms.i18núsphinx.transforms.referencesú!sphinx.transforms.post_transformsú&sphinx.transforms.post_transforms.codeú(sphinx.transforms.post_transforms.imagesúsphinx.util.compatúsphinx.versioningú*sphinx.environment.collectors.dependenciesú#sphinx.environment.collectors.assetú&sphinx.environment.collectors.metadataú#sphinx.environment.collectors.titleú%sphinx.environment.collectors.toctreeúsphinxcontrib.applehelpúsphinxcontrib.devhelpúsphinxcontrib.htmlhelpúsphinxcontrib.serializinghtmlúsphinxcontrib.qthelpÚ alabasterzenvironment.picklec @ s® e Zd ZU dZeedej ej
ddddddf eee eeee
eeeeee eeeddddZddd d
Zedddd
ZeddddZeddddZddddZdeee ddddZeddddZeddddZdeeeed d!d"Zedd#d$d%Zf d&eeeee d'f ed(d)d*Z f d&eeeee d'f ed(d+d,Z!ded edd-d.d/Z"f feee#eef edd0d1d2Z$eddd3d4Z%deee&j' edd5d6d7Z(dee) eeeee f dd8d9d:Z*dee) ee+eeeef dd;d<d=Z,deee- edd>d?d@Z.deeeddAdBdCZ/deeeddDdEdFZ0dee1 eddGdHdIZ2deeee- eddJdKdLZ3deee#e4e5f eddMdNdOZ6deee7 eddPdQdRZ8dSdddSg dfeeeeee9 eeeddT dUdVZ:deeeee9 eeddWdXdYZ;ee< ddZd[d\Z=ee< ddZd]d^Z>deeee edd_d`daZ?deeeddbdcddZ@d eeeddedfdgZAd¡eeeddhdidjZBeeeC ddkdldmZDd¢eeddndodpZEeeeeegef ddqdrdsZFeddtdudvZGd£eeeddwdxdyZHd¤eeI eddzd{d|ZJeeK dd}d~dZLeeddddZMd¥eeeef eeef dddd
ZNeeddddZOeedddZPdd ZQeRe
eef dddZSdS )¦ÚSphinxa The main application class and extensibility interface.
:ivar srcdir: Directory containing source.
:ivar confdir: Directory containing ``conf.py``.
:ivar doctreedir: Directory for storing pickled doctrees.
:ivar outdir: Directory for storing build documents.
NFr )ÚsrcdirÚconfdirÚoutdirÚ
doctreedirÚbuildernameÚ
confoverridesÚstatusÚwarningÚfreshenvÚwarningiserrorÚtagsÚ verbosityÚparallelÚ
keep_goingÚreturnc C sþ t j| _|| _i | _d | _d | _d | _t | _ t
|| _t
|| _t
|| _
tj| jsjttd| j tj| jrtj| j rttd| j | j| jkr®ttd|
| _|d krÌt | _d| _n|| _d| _|d krêt | _n|| _d| _|
oü|| _| jrd| _n|
| _tj| | j| j t| | _tdd| _ t!j"t#td t$j% d| _&t'|| _(|d kr| j| _)t*i |pi | _+n$t
|| _)t*j,| j)|p¦i | j(| _+| j+j- | j. | j+j/rð| j+j/t$j%krðt0td
| j+j/ xt1D ]}| j2| qöW x| j+jD ]}| j2| qW | j3| tj|s^t4td t5| W d Q R X | j+jr°tdd
}t6|. t7| j+jr| j+j| nt8tdW d Q R X | j+j9 | jj:d| j+ t;| j| j+j<| _| j=|| _| j>| | j? d S )Nz!Cannot find source directory (%s)z(Output directory (%s) is not a directoryz>Source directory and destination directory cannot be identicalTFr é