관리-도구
편집 파일: check.cpython-39.opt-1.pyc
a �����DOg����������������������@���s����d�Z�ddlmZ�ddlmZ�zHddlmZ�ddlmZ�ddl m Z �ddl mZ�G�dd ��d e�Zd Z W�n�eyz���dZ Y�n0�G�dd ��d e�ZdS�)zCdistutils.command.check Implements the Distutils 'check' command. �����)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodesc�������������������@���s���e�Zd�Zd dd�Zdd��ZdS�) �SilentReporterNr����ascii�replacec�������������� ���C���s"���g�|�_�t�|�|||||||��d�S��N)�messagesr����__init__)�self�source�report_level� halt_level�stream�debug�encoding� error_handler��r����//usr/lib64/python3.9/distutils/command/check.pyr ������s�����zSilentReporter.__init__c�����������������O���s8���|�j��||||f��tj|g|�R�||�j|�d�|��S�)N)�level�type)r����appendr����system_messageZlevels)r���r����messageZchildren�kwargsr���r���r���r������s�������zSilentReporter.system_message)Nr���r ���r ���)�__name__� __module__�__qualname__r ���r���r���r���r���r���r������s������ r���TFc�������������������@���s\���e�Zd�ZdZdZg�d�Zg�d�Zdd��Zdd��Zd d ��Z dd��Z d d��Zdd��Zdd��Z dS�)�checkz6This command checks the meta-data of the package. z"perform some checks on the package))�metadata�mzVerify meta-data)�restructuredtext�rzEChecks if long string meta-data syntax are reStructuredText-compliant)�strict�sz(Will exit with an error if a check fails)r"���r$���r&���c�����������������C���s���d|�_�d|�_d|�_d|�_dS�)z Sets default values for options.r�������N)r$���r"���r&���� _warnings�r���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�)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|�����|�jr0tr"|�����n|�jr0td��|�jrH|�jdkrHtd��dS�)zRuns the command.zThe docutils package is needed.r���zPlease 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�}dD�]"}t||�r(t||�s|�|��q|rL|��dd�|����|jrd|js�|��d��n"|j r||j s�|��d��n |��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. )�name�version�urlzmissing 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-����joinZauthorZauthor_emailZ maintainerZmaintainer_email)r���r"����missing�attrr���r���r���r/���O���s����zcheck.check_metadatac�����������������C���sX���|�j����}|��|�D�]>}|d��d�}|du�r8|d�}nd|d�|f�}|��|��qdS�)z4Checks if the long string fields are reST-compliant.����lineNr(���z%s (line %s))r6���Zget_long_description�_check_rst_data�getr-���)r����data�warningr=���r���r���r���r1���p���s���� zcheck.check_restructuredtextc�������������� ���C���s����|�j�jp d}t��}tjtfd����}d|_d|_d|_t ||j |j|j|j |j|jd�}tj|||d�}|�|d��z|�||��W�n<�ty��}�z$|j�dd|�d i�f��W�Y�d}~n d}~0�0�|jS�) z8Returns warnings when the provided data doesn't compile.zsetup.py)� components����N)r���r���r���r���)r���r<���z!Could not finish the parsing: %s.��)r6����script_namer���r���ZOptionParserZget_default_valuesZ tab_widthZpep_referencesZrfc_referencesr���r���r���Zwarning_streamr���Zerror_encodingZerror_encoding_error_handlerr����documentZnote_source�parse�AttributeErrorr���r���)r���r@����source_path�parserZsettingsZreporterrF����er���r���r���r>���{���s.������zcheck._check_rst_dataN)r���r���r ����__doc__�descriptionZuser_optionsZboolean_optionsr+���r,���r-���r2���r/���r1���r>���r���r���r���r���r!���#���s���!r!���N)rL���Zdistutils.corer���Zdistutils.errorsr���Zdocutils.utilsr���Zdocutils.parsers.rstr���Zdocutilsr���r���r���r0���� Exceptionr!���r���r���r���r����<module>���s���