o ?Og@s ddlmZddlmZz$ddlmZddlmZddlm Z ddlm Z GdddeZ d Z Wn e y<d Z YnwGd d d eZd S))Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc@s"eZdZ  d ddZddZdS) SilentReporterNrasciireplacec Cs"g|_t||||||||dSN)messagesr__init__)selfsource report_level halt_levelstreamdebugencoding error_handlerr>/opt/alt/python310/lib64/python3.10/distutils/command/check.pyr szSilentReporter.__init__cOs8|j||||ftj|g|R||j|d|S)N)leveltype)r appendrsystem_messageZlevels)rrmessagechildrenkwargsrrrrszSilentReporter.system_message)Nrr r )__name__ __module__ __qualname__r rrrrrrs  rTFc@sZeZdZ dZgdZgdZddZddZdd Zd d Z d d Z ddZ ddZ dS)checkz"perform some checks on the package))metadatamzVerify meta-data)restructuredtextrzEChecks if long string meta-data syntax are reStructuredText-compliant)strictsz(Will exit with an error if a check fails)r#r%r'cCs d|_d|_d|_d|_dS)Nr)r%r#r' _warningsrrrrinitialize_options0s  zcheck.initialize_optionscCsdSr rr+rrrfinalize_options7szcheck.finalize_optionscCs |jd7_t||S)Nr))r*rwarn)rmsgrrrr.:s z check.warncCsR |jr||jrtr|n|jrtd|jr%|jdkr'tddSdS)NzThe docutils package is needed.rzPlease correct your package.)r#check_metadatar% HAS_DOCUTILScheck_restructuredtextr'rr*r+rrrrun?s z check.runcCs |jj}g}dD]}t||rt||s||q |r'|dd||jr6|js4|ddSdS|j rE|j sC|ddSdS|ddS)N)nameversionZurlzmissing required meta-data: %sz, zNmissing meta-data: if 'author' supplied, 'author_email' should be supplied toozVmissing meta-data: if 'maintainer' supplied, 'maintainer_email' should be supplied toozkmissing meta-data: either (author and author_email) or (maintainer and maintainer_email) should be supplied) distributionr#hasattrgetattrrr.joinZauthorZ author_emailZ maintainerZmaintainer_email)rr#Zmissingattrrrrr0Os$  zcheck.check_metadatacCsZ |j}||D]}|dd}|dur|d}nd|d|f}||q dS)Nliner)z %s (line %s))r6Zget_long_description_check_rst_datagetr.)rdataZwarningr<rrrr2ps   zcheck.check_restructuredtextc Cs |jjpd}t}tjtfd}d|_d|_d|_t ||j |j |j |j |j|jd}tj|||d}||dz |||W|jStye}z|jdd|difWYd}~|jSd}~ww) Nzsetup.py)Z components)rrrr)rr;z!Could not finish the parsing: %s.)r6Z script_namerrZ OptionParserZget_default_valuesZ tab_widthZpep_referencesZrfc_referencesrrrZwarning_streamrZerror_encodingZerror_encoding_error_handlerrdocumentZ note_sourceparseAttributeErrorr r)rr? source_pathparserZsettingsZreporterrBerrrr={s6  zcheck._check_rst_dataN) rr r! descriptionZ user_optionsZboolean_optionsr,r-r.r3r0r2r=rrrrr"#s! r"N)Zdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrrr1 Exceptionr"rrrrs