<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    Re                 @   s   d Z ddlmZ ddlmZ yHddlmZ ddlmZ ddl	m
Z
 ddl	mZ G dd	 d	eZd
ZW n ek
r|   dZY nX G dd deZdS )zCdistutils.command.check

Implements the Distutils 'check' command.
    )Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc               @   s   e Zd Zd	ddZdd ZdS )
SilentReporterNr   asciireplacec          
   C   s"   g | _ t| ||||||| d S )N)messagesr   __init__)selfsourcereport_level
halt_levelstreamdebugencodingerror_handler r   /builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/check.pyr      s    zSilentReporter.__init__c             O   s6   | j ||||f tj|f||| j| d|S )N)leveltype)r   appendr   system_messagelevels)r   r   messagechildrenkwargsr   r   r   r      s    zSilentReporter.system_message)Nr   r	   r
   )__name__
__module____qualname__r   r   r   r   r   r   r      s    
r   TFc               @   s`   e Zd ZdZdZdddgZdddgZd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd ZdS )checkz6This command checks the meta-data of the package.
    z"perform some checks on the package)metadatamzVerify meta-data)restructuredtextrzEChecks if long string meta-data syntax are reStructuredText-compliant)strictsz(Will exit with an error if a check failsr#   r%   r'   c             C   s   d| _ d| _d| _d| _dS )z Sets default values for options.r      N)r%   r#   r'   	_warnings)r   r   r   r   initialize_options0   s    zcheck.initialize_optionsc             C   s   d S )Nr   )r   r   r   r   finalize_options7   s    zcheck.finalize_optionsc             C   s   |  j d7  _ t| |S )z*Counts the number of warnings that occurs.r)   )r*   r   warn)r   msgr   r   r   r-   :   s    z
check.warnc             C   sL   | j r|   | jr0tr"|   n| jr0td| jrH| jdkrHtddS )zRuns the command.zThe docutils package is needed.r   zPlease correct your package.N)r#   check_metadatar%   HAS_DOCUTILScheck_restructuredtextr'   r   r*   )r   r   r   r   run?   s    
z	check.runc             C   s   | j j}g }x*dD ]"}t||r*t||s|| qW |rP| dd|  |jrh|js| d n"|j	r|j
s| d n
| d dS )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.
        )nameversionurlzmissing 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#   hasattrgetattrr   r-   joinauthorauthor_email
maintainermaintainer_email)r   r#   missingattrr   r   r   r/   O   s    
zcheck.check_metadatac             C   s\   | j  }xL| |D ]>}|d d}|dkr:|d }nd|d |f }| | qW dS )z4Checks if the long string fields are reST-compliant.lineNr)   z%s (line %s))r6   get_long_description_check_rst_datagetr-   )r   datawarningrA   r   r   r   r1   p   s    

zcheck.check_restructuredtextc          
   C   s   | j jp
d}t }tjtfd }d|_d|_d|_t	||j
|j|j|j|j|jd}tj|||d}||d y||| W n: tk
r } z|jdd| d	i f W dd}~X Y nX |jS )
z8Returns warnings when the provided data doesn't compile.zsetup.py)
components   N)r   r   r   r   )r   r@   z!Could not finish the parsing: %s. )r6   script_namer   r   OptionParserget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr   r   r   Zwarning_streamr   Zerror_encodingZerror_encoding_error_handlerr   documentZnote_sourceparseAttributeErrorr   r   )r   rE   source_pathparsersettingsZreporterrM   er   r   r   rC   {   s*    
$zcheck._check_rst_dataN)r   r    r!   __doc__descriptionuser_optionsboolean_optionsr+   r,   r-   r2   r/   r1   rC   r   r   r   r   r"   #   s   
!r"   N)rT   distutils.corer   distutils.errorsr   Zdocutils.utilsr   Zdocutils.parsers.rstr   Zdocutilsr   r   r   r0   	Exceptionr"   r   r   r   r   <module>   s   
