a XC?h�@s�ddlmZddlmZzHddlmZddlmZddlm Z ddlm Z Gdd�de�Z d Z Wne yvd Z Yn0Gd d �d e�Zd S)�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodesc@seZdZd dd�Zdd�ZdS) �SilentReporterNr�ascii�replacec Cs"g|_t�||||||||�dS�N)�messagesr�__init__)�self�source� report_level� halt_level�stream�debug�encoding� error_handler�r�}|d�d�}|dur8|d}nd|d|f}|�|�qdS)N������liner(z %s (line %s))r5Zget_long_description�_check_rst_data�getr-)r�dataZwarningr;rrrr1ps  zcheck.check_restructuredtextc Cs�|jjp d}t�}tjtfd���}d|_d|_d|_t ||j |j |j |j |j|jd�}tj|||d�}|�|d�z|�||�Wn<ty�}z$|j�dd|dif�WYd}~n d}~00|jS) Nzsetup.py)Z components�)rrrr)rr:z!Could not finish the parsing: %s.�)r5Z script_namerrZ OptionParserZget_default_valuesZ tab_widthZpep_referencesZrfc_referencesrrrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZ note_source�parse�AttributeErrorr r)rr>� source_path�parserZsettingsZreporterrA�errrr<{s. � �zcheck._check_rst_dataN) rrr Z descriptionZ user_optionsZboolean_optionsr+r,r-r2r/r1r<rrrrr!#s! r!N)Zdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrrr0� Exceptionr!rrrr�s