Viewing File: /opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/check.cpython-35.opt-1.pyc



®ÕYfxã@sËdZddlmZddlmZypddlmZddlmZddl	m
Z
ddl	mZddlm
Z
Gd	d
„d
eƒZdZWnek
r°dZYnXGd
d„deƒZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
é)Ú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/distutils/command/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ŽeZdZdZdZdddgZddd	gZdd
„Zdd„Zdd„Z	dd„Z
dd„Zdd„Zdd„Z
dS)Úcheckz6This command checks the meta-data of the package.
    z"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)z Sets default values for options.réN)r%r"r(Ú	_warnings)rrrrÚinitialize_options1s			zcheck.initialize_optionscCsdS)Nr)rrrrÚfinalize_options8szcheck.finalize_optionscCs|jd7_tj||ƒS)z*Counts the number of warnings that occurs.r+)r,rÚwarn)rÚmsgrrrr/;sz
check.warncCsl|jr|jƒ|jrDtr/|jƒn|jrDtdƒ‚|jrh|jdkrhtdƒ‚dS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r"Úcheck_metadatar%ÚHAS_DOCUTILSÚcheck_restructuredtextr(rr,)rrrrÚrun@s	
	
	z	check.runcCsÓ|jj}g}x9dD]1}t||ƒo:t||ƒs|j|ƒqW|rn|jddj|ƒƒ|jr”|jsÏ|jddƒn;|j	rº|j
sÏ|jdd	ƒn|jd
ddƒd
S)zÏ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.
        Ú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 suppliedN)r5r6r7)Údistributionr"ÚhasattrÚgetattrrr/ÚjoinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr"ZmissingÚattrrrrr1Ps$
						zcheck.check_metadatacCsz|jjƒ}xd|j|ƒD]S}|djdƒ}|dkrQ|d}nd|d|f}|j|ƒqWdS)z4Checks if the long string fields are reST-compliant.r+ÚlineNz%s (line %s)éÿÿÿÿ)r8Zget_long_descriptionÚ_check_rst_dataÚgetr/)rÚdataZwarningr=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
|difƒWYdd}~XnX|jS)z8Returns warnings when the provided data doesn't compile.Z
componentséNrrrrrr+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)rrAÚsource_pathÚparserZsettingsZreporterrDÚerrrr?ys*										*zcheck._check_rst_dataN)r"r#r$)r%r&r')r(r)r*)rrr Ú__doc__ZdescriptionZuser_optionsZboolean_optionsr-r.r/r4r1r3r?rrrrr!$s	r!N)rJZdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrÚiorr	r2Ú	Exceptionr!rrrrÚ<module>s


Back to Directory File Manager