3
T'ícÕ0 ã @ sÀ d Z ddlZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl
mZmZm
Z
ddlmZ ddlZddlmZmZ ddlmZ ddlmZ dd lmZ dd
lmZmZmZ ddlmZmZm Z m!Z! ddl"m#Z#m$Z$ dd
l%m&Z&m'Z' ej(feee)eddddZ*e+e,dddZ-ej.dddZ/ej0dd
fe
e+ e,dddZ1ej0dd
fe
e+ e,dddZ2ej0dd
fe
e+ e,dddZ3e4dkr¼ej5e3ej0dd
dS ) z+Build documentation from a provided source.é N)Úpath)ÚIOÚAnyÚList)Ú
SystemMessage)Ú__display_version__Úpackage_dir)ÚSphinx)ÚSphinxError)Ú__)ÚTeeÚformat_exception_cut_framesÚsave_traceback)Úcolor_terminalÚnocolorÚredÚ
terminal_safe)Údocutils_namespaceÚpatch_docutils)ÚabspathÚ ensuredir)ÚappÚargsÚ exceptionÚstderrÚreturnc C s( t |tjrd S |jrHtttd|d tj tj t
j d nÜt|d |js^|jrttjd | t|d t |t
rttd|d nt |trÊtttd|d tt|jd |d nZt |trþttd|j |d tt||d n&t |trTtttd|d ttt||d t| }tttd | |d nÐt |tr¾d
t|kr¾tttd|d ttt||d t|d ttd|d td
|d nftttd|d tt j |d t| }tttd | |d ttd|d ttd|d d S )Nz5Exception occurred while building, starting debugger:)Úfileé zInterrupted!zreST markup error:r z%s:zEncoding error:z[The full traceback has been saved in %s, if you want to report the issue to the developers.zrecursion depthzRecursion error:zThis can happen with very large or deeply nested source files. You can carefully increase the default Python recursion limit of 1000 in conf.py with e.g.:z+ import sys; sys.setrecursionlimit(1500)zException occurred:ziPlease also report this if it was a user error, so that a better error message can be provided next time.zbA bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!)Ú
isinstanceÚbdbZBdbQuitÚpdbÚprintr r Ú tracebackÚ print_excZpost_mortemÚsysÚexc_infoÚ verbosityÚKeyboardInterruptr r r r