Your IP : 3.143.237.203


Current Path : /opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/check.cpython-35.opt-2.pyc



���]x�@s�ddlmZddlmZypddlmZddlmZddlm	Z	ddlm
Z
ddlmZGdd	�d	e�Z
d
ZWnek
r�dZYnXGdd
�d
e�ZdS)�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodes)�StringIOc@s4eZdZdddddd�Zdd�ZdS)	�SilentReporterNr�ascii�replacec	Cs/g|_tj||||||||�dS)N)�messagesr�__init__)�self�source�report_level�
halt_level�stream�debug�encoding�
error_handler�r�*/opt/alt/python35/lib64/python3.5/check.pyr
s	zSilentReporter.__init__cOsB|jj||||f�tj||d|d|j||�S)N�level�type)r�appendr�system_messageZlevels)rr�messageZchildren�kwargsrrrrs	zSilentReporter.system_message)�__name__�
__module__�__qualname__r
rrrrrr	sr	TFc@s�eZdZdZdddgZdddgZdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�ZdS)�checkz"perform some checks on the package�metadata�m�Verify meta-data�restructuredtext�r�EChecks if long string meta-data syntax are reStructuredText-compliant�strict�s�(Will exit with an error if a check failscCs(d|_d|_d|_d|_dS)Nr�)r%r"r(�	_warnings)rrrr�initialize_options1s			zcheck.initialize_optionscCsdS)Nr)rrrr�finalize_options8szcheck.finalize_optionscCs|jd7_tj||�S)Nr+)r,r�warn)r�msgrrrr/;sz
check.warncCsl|jr|j�|jrDtr/|j�n|jrDtd��|jrh|jdkrhtd��dS)NzThe docutils package is needed.rzPlease correct your package.)r"�check_metadatar%�HAS_DOCUTILS�check_restructuredtextr(rr,)rrrr�run@s	
	
	z	check.runcCs�|jj}g}x9d
D]1}t||�o:t||�s|j|�qW|rn|jddj|��|jr�|js�|jdd�n;|j	r�|j
s�|jdd	�n|jd
dd�dS)N�name�version�urlzmissing required meta-data: %sz, z)missing meta-data: if 'author' supplied, z#'author_email' must be supplied tooz-missing meta-data: if 'maintainer' supplied, z''maintainer_email' must be supplied tooz4missing meta-data: either (author and author_email) z%or (maintainer and maintainer_email) zmust be supplied)r5r6r7)�distributionr"�hasattr�getattrrr/�joinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr"�missing�attrrrrr1Ps$
						zcheck.check_metadatacCsz|jj�}xd|j|�D]S}|djd�}|dkrQ|d}nd|d|f}|j|�qWdS)Nr+�linez%s (line %s)���)r8Zget_long_description�_check_rst_data�getr/)r�data�warningr>rrrr3ns
zcheck.check_restructuredtextcCst�}t�}tjdtf�j�}d|_d|_d|_t||j	|j
d|jd|jd|j
d|j�}tj||d|�}|j|d�y|j||�WnEtk
r}z%|jjdd	|d
if�WYdd}~XnX|jS)
NZ
components�rrrrrr+z!Could not finish the parsing: %s.�r?r?)rrrZOptionParserZget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr	rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZnote_source�parse�AttributeErrorrr)rrB�source_path�parserZsettingsZreporterrF�errrr@ys*										*zcheck._check_rst_dataN)r"r#r$)r%r&r')r(r)r*)
rrr �descriptionZuser_optionsZboolean_optionsr-r.r/r4r1r3r@rrrrr!$s	r!N)Zdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrr�iorr	r2�	Exceptionr!rrrr�<module>s



?>