`vë d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddl mZ G d d e Zd Z n # e$ r dZ Y nw xY w G d d e ZdS )zCdistutils.command.check Implements the Distutils 'check' command. )Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc e Zd Z ddZd ZdS )SilentReporterNr asciireplacec J g | _ t j | ||||||| d S N)messagesr __init__)selfsourcereport_level halt_levelstreamdebugencoding error_handlers D/opt/alt/python-internal/lib64/python3.11/distutils/command/check.pyr zSilentReporter.__init__ s9 DMdFL*f#X} > > > > > c | j ||||f t j |g|R || j | d|S )N)leveltype)r appendr system_messagelevels)r r messagechildrenkwargss r r zSilentReporter.system_message sc M %(F!CDDD' =)1= =u-1[-?= =5;= = =r )Nr r r )__name__ __module____qualname__r r r r r r s= DH>G > > > > = = = = =r r TFc P e Zd ZdZdZg dZg dZd Zd Zd Z d Z d Zd Zd Z dS ) checkz6This command checks the meta-data of the package. z"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. c > d| _ d| _ d| _ d| _ dS )z Sets default values for options.r N)r, r* r. _warningsr s r initialize_optionszcheck.initialize_options0 s# ! r c d S r r' r3 s r finalize_optionszcheck.finalize_options7 s r c L | xj dz c_ t j | | S )z*Counts the number of warnings that occurs.r1 )r2 r warn)r msgs r r8 z check.warn: s$ !|D#&&&r c | j r| | j r2t r| n| j rt d | j r| j dk rt d dS dS )zRuns the command.zThe docutils package is needed.r zPlease correct your package.N)r* check_metadatar, HAS_DOCUTILScheck_restructuredtextr. r r2 r3 s r runz check.run? s = "!!! M M++---- M)*KLLL ; F4>A--%&DEEE F F--r c | j j }g }dD ]7}t || rt || s| | 8|r+| dd | z |j r |j s| d dS dS |j r |j s| d dS dS | d dS )a Ensures that all required elements of meta-data are supplied. Required fields: name, version, URL Recommended fields: (author and author_email) or (maintainer and maintainer_email) Warns if any are missing. )nameversionurlzmissing 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 suppliedN)distributionr* hasattrgetattrr r8 joinauthorauthor_email maintainermaintainer_email)r r* missingattrs r r; zcheck.check_metadataO sJ $-. % %DHd++ %$0G0G %t$$$ NII6$))G:L:LLMMM? ,( C B C C C C C C C ,, G F G G G G G G G II + , , , , ,r c | j }| | D ]K}|d d }| |d }n|d d|d}| | LdS )z4Checks if the long string fields are reST-compliant.lineNr1 z (line ))rC get_long_description_check_rst_datagetr8 )r datawarningrO s r r= zcheck.check_restructuredtextp s 5577++D11 G2;??6**D|!!*,3AJJJ=IIg r c | j j pd}t } t j } |t }n=# t $ r0 t j t f }Y nw xY wd|_ d|_ d|_ t ||j |j |j |j |j |j }t% j ||| }| |d | || n8# t $ r+}|j dd|z d i f Y d}~nd}~ww xY w|j S ) z8Returns warnings when the provided data doesn't compile.zsetup.py) components N)r r r r )r rN z!Could not finish the parsing: %s. )rC script_namer r get_default_settingsAttributeErrorOptionParserget_default_values tab_widthpep_referencesrfc_referencesr r r warning_streamr error_encodingerror_encoding_error_handlerr documentnote_sourceparser r ) r rT source_pathparserr[ settingsreporterre es r rR zcheck._check_rst_data{ s '3Az 4#+#@ ,+F33HH X X X, BBBUUWWHHH X "&"&!+"/"-!)!8 (#+#:(0(M O O O >(H[III["--- GLLx(((( G G G$$81