ó Þ†dSc@sìdZddlZddlZddlZddlmZddlmZddlZddlm Z m Z ej ddƒZ d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQgZ d8efd9„ƒYZd:„ZdS(RsË sphinx.make_mode ~~~~~~~~~~~~~~~~ sphinx-build -M command-line handling. This replaces the old, platform-dependent and once-generated content of Makefile / make.bat. This is in its own module so that importing it is fast. It should not import the main Sphinx modules (like sphinx.applications, sphinx.builders). :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿN(tpath(tcall(tboldtbluet SPHINXPROJs tthtmlsto make standalone HTML filestdirhtmls2to make HTML files named index.html in directoriest singlehtmls to make a single large HTML filetpicklesto make pickle filestjsonsto make JSON filesthtmlhelps*to make HTML files and a HTML help projecttqthelps'to make HTML files and a qthelp projecttdevhelps(to make HTML files and a Devhelp projecttepubsto make an epubtlatexs9to make LaTeX files, you can set PAPER=a4 or PAPER=lettertposixtlatexpdfs1to make LaTeX files and run them through pdflatext latexpdfjas8to make LaTeX files and run them through platex/dvipdfmxttextsto make text filestmansto make manual pagesttexinfosto make Texinfo filestinfos3to make Texinfo files and run them through makeinfotgettextsto make PO message catalogstchangess9to make an overview of all changed/added/deprecated itemstxmls!to make Docutils-native XML filest pseudoxmls0to make pseudoxml-XML files for display purposest linkchecks)to check all external links for integritytdoctests>to run all doctests embedded in the documentation (if enabled)tcoverages7to run coverage check of the documentation (if enabled)tMakecBsþeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„ZRS(cCs||_||_||_dS(N(tsrcdirtbuilddirtopts(tselfRR R!((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt__init__<s  cGstj|j|ŒS(N(RtjoinR (R"tcomps((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt builddir_joinAscCs{tj|jƒsdStj|jƒs8d|jGHdSd|jGHx0tj|jƒD]}tj|j|ƒƒqWWdS(NsError: %r is not a directory!isRemoving everything under %r...( RtexistsR tisdirtostlistdirtshutiltrmtreeR&(R"titem((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_cleanDs  cCs}tdtjƒGHdtdƒfdGHxNtD]F\}}}| sTtj|kr/dt|jdƒƒ|fGHq/q/WdS(Ns Sphinx v%ss'Please use `make %s' where %s is one ofttargetis %s %si (Rtsphinxt __version__RtBUILDERSR)tnametljust(R"tosnametbnamet description((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_helpNs cCs0|jdƒdkrdSHd|jdƒGHdS(NRiis)Build finished. The HTML pages are in %s.(trun_generic_buildR&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_htmlUscCs0|jdƒdkrdSHd|jdƒGHdS(NRiis)Build finished. The HTML pages are in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_dirhtml[scCs0|jdƒdkrdSHd|jdƒGHdS(NRiis'Build finished. The HTML page is in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytbuild_singlehtmlas cCs#|jdƒdkrdSHdGHdS(NR iis5Build finished; now you can process the pickle files.(R9(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_picklehscCs#|jdƒdkrdSHdGHdS(NR iis3Build finished; now you can process the JSON files.(R9(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_jsonnscCs0|jdƒdkrdSHd|jdƒGHdS(NR iisTBuild finished; now you can run HTML Help Workshop with the .hhp project file in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytbuild_htmlhelpts cCs_|jdƒdkrdSHd|jdƒGHd|jdtƒGHdGHd|jdtƒGHdS(NR iisdBuild finished; now you can run "qcollectiongenerator" with the .qhcp project file in %s, like this:s$ qcollectiongenerator %s.qhcpsTo view the help file:s"$ assistant -collectionFile %s.qhc(R9R&t proj_name(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_qthelp{scCsN|jdƒdkrdSHdGHdGHdtGHd|jdƒtfGHdGHdS( NR iisBuild finished.sTo view the help file:s&$ mkdir -p $HOME/.local/share/devhelp/s($ ln -s %s $HOME/.local/share/devhelp/%ss $ devhelp(R9R@R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_devhelp†s cCs0|jdƒdkrdSHd|jdƒGHdS(NRiis'Build finished. The ePub file is in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_epub‘scCsK|jdƒdkrdSd|jdƒGHtjdkrGdGHdGHndS(NRiis*Build finished; the LaTeX files are in %s.Rs<Run `make' in that directory to run these through (pdf)latexs4(use `make latexpdf' here to do that automatically).(R9R&R)R3(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_latex—s cCs7|jdƒdkrdStjd|jdƒƒdS(NRiismake -C %s all-pdf(R9R)tsystemR&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytbuild_latexpdfŸscCs7|jdƒdkrdStjd|jdƒƒdS(NRiismake -C %s all-pdf-ja(R9R)RER&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytbuild_latexpdfja¤scCs0|jdƒdkrdSHd|jdƒGHdS(NRiis)Build finished. The text files are in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_text©scCsK|jdƒdkrdSd|jdƒGHtjdkrGdGHdGHndS(NRiis,Build finished; the Texinfo files are in %s.Rs:Run `make' in that directory to run these through makeinfos0(use `make info' here to do that automatically).(R9R&R)R3(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_texinfo¯scCs7|jdƒdkrdStjd|jdƒƒdS(NRiismake -C %s info(R9R)RER&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_info¸scCsH|jddƒ}|jdd|ƒdkr1dSHd|jdƒGHdS(NRs .doctreest doctreediriis/Build finished. The message catalogs are in %s.(R&R9(R"tdtdir((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_gettext½s cCs0|jdƒdkrdSHd|jdƒGHdS(NRiis+Build finished. The overview file is in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_changesÅs cCs)|jdƒ}Hd|jddƒGH|S(NRsFLink check complete; look for any errors in the above output or in %s.s output.txt(R9R&(R"tres((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytbuild_linkcheckÌs cCs(|jdƒ}d|jddƒGH|S(NRsGTesting of doctests in the sources finished, look at the results in %s.s output.txt(R9R&(R"RO((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_doctestÓscCs5|jdƒdkrdGHdSHd|jdƒGHdS(NRis(Has the coverage extension been enabled?isGTesting of coverage in the sources finished, look at the results in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytbuild_coverageÙs cCs0|jdƒdkrdSHd|jdƒGHdS(NRiis(Build finished. The XML files are in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt build_xmláscCs0|jdƒdkrdSHd|jdƒGHdS(NRiis/Build finished. The pseudo-XML files are in %s.(R9R&(R"((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytbuild_pseudoxmlçs cCsŸtjddƒ}|j}|d krA|jdd|gƒn|dkr_|jdƒ}nttjtj dd |g|d ||j |j|ƒgƒS( NtPAPERRta4tletters-Dslatex_paper_size=tdoctreesis-bs-d(RVRW( R)tgetenvR!textendtNoneR&Rtsyst executabletargvR(R"tbuilderRKt papersizeR!((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyR9îs    N(t__name__t __module__R#R&R.R8R:R;R<R=R>R?RARBRCRDRFRGRHRIRJRMRNRPRQRRRSRTR[R9(((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyR:s6                      cCst|ƒdkr#tjdIJdSt|d|d|dƒ}d|d}t||ƒrnt||ƒƒS|j|dƒS(NisJError: at least 3 arguments (builder, source dir, build dir) are required.iitbuild_i(tlenR\tstderrRthasattrtgetattrR9(targstmaket run_method((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pyt run_make_modeús (Rshtmlsto make standalone HTML files(Rsdirhtmls2to make HTML files named index.html in directories(Rs singlehtmls to make a single large HTML file(Rspicklesto make pickle files(Rsjsonsto make JSON files(Rshtmlhelps*to make HTML files and a HTML help project(Rsqthelps'to make HTML files and a qthelp project(Rsdevhelps(to make HTML files and a Devhelp project(Rsepubsto make an epub(Rslatexs9to make LaTeX files, you can set PAPER=a4 or PAPER=letter(sposixRs1to make LaTeX files and run them through pdflatex(sposixRs8to make LaTeX files and run them through platex/dvipdfmx(Rstextsto make text files(RRsto make manual pages(Rstexinfosto make Texinfo files(sposixsinfos3to make Texinfo files and run them through makeinfo(Rsgettextsto make PO message catalogs(Rschangess9to make an overview of all changed/added/deprecated items(Rsxmls!to make Docutils-native XML files(Rs pseudoxmls0to make pseudoxml-XML files for display purposes(Rs linkchecks)to check all external links for integrity(Rsdoctests>to run all doctests embedded in the documentation (if enabled)(Rscoverages7to run coverage check of the documentation (if enabled)(t__doc__R)R\R+Rt subprocessRR0tsphinx.util.consoleRRRYR@R2tobjectRRk(((s:/usr/local/lib/python2.7/site-packages/sphinx/make_mode.pytsB     À