��Qc@s�dZdZddlmZddlmZddlmZypddlm Z ddl
mZddlm
Z
dd lmZdd
lmZde fd��YZeZWnek
r�eZnXd
efd��YZdS(sCdistutils.command.check
Implements the Distutils 'check' command.
s$Id$i�(tCommand(tPKG_INFO_ENCODING(tDistutilsSetupError(tReporter(tParser(tfrontend(tnodes(tStringIOtSilentReportercBs&eZddddd�Zd�ZRS(itasciitreplacec Cs/g|_tj||||||||�dS(N(tmessagesRt__init__(tselftsourcetreport_levelt
halt_leveltstreamtdebugtencodingt
error_handler((s-/sys/lib/python2.7/distutils/command/check.pyRs cOsB|jj||||f�tj|d|d|j|||�S(Ntlevelttype(RtappendRtsystem_messagetlevels(R
Rtmessagetchildrentkwargs((s-/sys/lib/python2.7/distutils/command/check.pyRs
N(t__name__t
__module__tNoneRR(((s-/sys/lib/python2.7/distutils/command/check.pyRstcheckcBsqeZdZdZdddgZdddgZd�Zd�Zd
�Zd�Z d�Z
d�Zd�ZRS(s6This command checks the meta-data of the package.
s"perform some checks on the packagetmetadatatmsVerify meta-datatrestructuredtexttrsEChecks if long string meta-data syntax are reStructuredText-complianttstricttss(Will exit with an error if a check failscCs(d|_d|_d|_d|_dS(s Sets default values for options.iiN(R#R!R%t _warnings(R
((s-/sys/lib/python2.7/distutils/command/check.pytinitialize_options3s cCsdS(N((R
((s-/sys/lib/python2.7/distutils/command/check.pytfinalize_options:scCs|jd7_tj||�S(s*Counts the number of warnings that occurs.i(R'Rtwarn(R
tmsg((s-/sys/lib/python2.7/distutils/command/check.pyR*=scCsx|jr|j�n|jrMtr2|j�qM|jrMtd��qMn|jrt|jdkrttd��ndS(sRuns the command.sThe docutils package is needed.isPlease correct your package.N(R!tcheck_metadataR#tHAS_DOCUTILStcheck_restructuredtextR%RR'(R
((s-/sys/lib/python2.7/distutils/command/check.pytrunBs
cCs�|jj}g}x<dD]4}t||�o:t||�s|j|�qqW|rt|jddj|��n|jr�|js�|jdd�q�n>|j r�|j
s�|jdd �q�n|jd
dd�d
S(s�Ensures that all required elements of meta-data are supplied.
name, version, URL, (author and author_email) or
(maintainer and maintainer_email)).
Warns if any are missing.
tnametversionturlsmissing required meta-data: %ss, s)missing meta-data: if 'author' supplied, s#'author_email' must be supplied toos-missing meta-data: if 'maintainer' supplied, s''maintainer_email' must be supplied toos4missing meta-data: either (author and author_email) s%or (maintainer and maintainer_email) smust be suppliedN(snamesversionR2(tdistributionR!thasattrtgetattrRR*tjointauthortauthor_emailt
maintainertmaintainer_email(R
R!tmissingtattr((s-/sys/lib/python2.7/distutils/command/check.pyR,Rs$
cCs�|jj�}t|t�s0|jt�}nxd|j|�D]S}|djd�}|dkrr|d}nd|d|f}|j |�q@WdS(s4Checks if the long string fields are reST-compliant.i�tlineis%s (line %s)N(
R3tget_long_descriptiont
isinstancetunicodetdecodeRt_check_rst_datatgetRR*(R
tdatatwarningR=((s-/sys/lib/python2.7/distutils/command/check.pyR.ps
cCs�t�}t�}tj�j�}d|_d
|_d
|_t ||j
|jd|jd|j
d|jd|j�}tj||d|�}|j|d�y|j||�Wn-tk
r�|jjddd if�nX|jS(s8Returns warnings when the provided data doesn't compile.iRRRRRi�sCould not finish the parsing.tN(RRRtOptionParsertget_default_valuest tab_widthRtpep_referencestrfc_referencesRRRtwarning_streamRterror_encodingterror_encoding_error_handlerRtdocumenttnote_sourcetparsetAttributeErrorRR(R
RDtsource_pathtparsertsettingstreporterRO((s-/sys/lib/python2.7/distutils/command/check.pyRB}s*
(smetadataR"sVerify meta-data(srestructuredtextR$sEChecks if long string meta-data syntax are reStructuredText-compliant(sstrictR&s(Will exit with an error if a check fails(
RRt__doc__tdescriptiontuser_optionstboolean_optionsR(R)R*R/R,R.RB(((s-/sys/lib/python2.7/distutils/command/check.pyR &s
N(RWt__revision__tdistutils.coreRtdistutils.distRtdistutils.errorsRtdocutils.utilsRtdocutils.parsers.rstRtdocutilsRRRRtTrueR-tImportErrortFalseR (((s-/sys/lib/python2.7/distutils/command/check.pyt<module>s
|