o 0i @ s d dl mZ d dlmZ z$d dlmZ d dlmZ d dlm Z d dlm Z G dd deZd ZW n e y< d ZY nw G dd deZd S ) )Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc @ s" e Zd Z d ddZdd ZdS ) SilentReporterNr asciireplacec C s" g | _ t| ||||||| d S N)messagesr __init__)selfsourcereport_level halt_levelstreamdebugencoding error_handler r >/opt/alt/python310/lib64/python3.10/distutils/command/check.pyr s zSilentReporter.__init__c O s8 | j ||||f tj|g|R || j| d|S )N)leveltype)r appendr system_messageZlevels)r r messagechildrenkwargsr r r r s zSilentReporter.system_message)Nr r r )__name__ __module____qualname__r r r r r r r s r TFc @ sZ e Zd Z dZg dZg dZdd Zdd Zdd Zd d Z dd Z dd Zdd ZdS )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' c C s d| _ d| _d| _d| _d S )Nr )r% r# r' _warningsr r r r initialize_options0 s zcheck.initialize_optionsc C s d S r r r+ r r r finalize_options7 s zcheck.finalize_optionsc C s | j d7 _ t| |S )Nr) )r* r warn)r msgr r r r. : s z check.warnc C sR | j r| | jrtr| n| jrtd| jr%| jdkr'tdd S d S )NzThe docutils package is needed.r zPlease correct your package.)r# check_metadatar% HAS_DOCUTILScheck_restructuredtextr' r r* r+ r r r run? s z check.runc C s | j j}g }dD ]}t||rt||s|| q |r'| dd| |jr6|js4| d d S d S |j rE|j sC| d d S d S | d d S )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# hasattrgetattrr r. joinZauthorZauthor_emailZ maintainerZmaintainer_email)r r# Zmissingattrr r r r0 O s$ zcheck.check_metadatac C sZ | j }| |D ]}|d d}|d u r|d }nd|d |f }| | qd S )Nliner) z%s (line %s))r6 Zget_long_description_check_rst_datagetr. )r dataZwarningr<