File: //usr/lib/python3/dist-packages/django/core/management/commands/__pycache__/check.cpython-310.pyc
o
�a� � @ sH d dl mZ d dlmZ d dlmZ d dlmZmZ G dd� de�Z dS )� )�apps)�checks)�registry)�BaseCommand�CommandErrorc @ s$ e Zd ZdZg Zdd� Zdd� ZdS )�Commandz8Checks the entire Django project for potential problems.c C sp |j dddd� |j ddddd d
� |j ddd
d� |j dddd� |j ddg d�dd� |j ddddd
� d S )N�args� app_label�*)�metavar�nargsz--tagz-t�append�tagsz'Run only checks labeled with given tag.)�action�dest�helpz--list-tags�
store_truezList available tags.)r r z--deployzCheck deployment settings.z--fail-level�ERROR)�CRITICALr �WARNING�INFO�DEBUGz[Message level that will cause the command to exit with a non-zero status. Default is ERROR.)�default�choicesr z
--database� databasesz2Run database related checks against these aliases.)�add_argument)�self�parser� r �G/usr/lib/python3/dist-packages/django/core/management/commands/check.py�
add_arguments s. ����
�zCommand.add_argumentsc s� |d � |d r| j �d�tt�� ���� d S |r"dd� |D �}nd }|d }|rGz
t� fdd�|D ��}W n ty@ Y nw td | ��| j ||d
� t
t|d �|d d
� d S )N�deploy� list_tags�
c S s g | ]}t �|��qS r )r �get_app_config)�.0r r r r �
<listcomp>/ s z"Command.handle.<locals>.<listcomp>r c 3 s � | ]}t �|� �s|V qd S )N)r �
tag_exists)r% �tag��include_deployment_checksr r � <genexpr>6 s � �
�z!Command.handle.<locals>.<genexpr>z+There is no system check with the "%s" tag.T�
fail_levelr )�app_configsr �display_num_errorsr* r, r )�stdout�write�join�sortedr �tags_available�next�
StopIterationr �check�getattrr )r �
app_labels�optionsr- r �invalid_tagr r) r �handle( s2 ��
�zCommand.handleN)�__name__�
__module__�__qualname__r �requires_system_checksr r; r r r r r s
r N)
�django.appsr �django.corer �django.core.checks.registryr �django.core.management.baser r r r r r r �<module> s