B
    ©0H[	  ã               @   sH   d dl mZ d dlmZ d dlmZ d dlmZmZ G dd„ deƒZ	dS )é    )Úapps)Úchecks)Úregistry)ÚBaseCommandÚCommandErrorc               @   s$   e Zd ZdZdZdd„ Zdd„ ZdS )ÚCommandz8Checks the entire Django project for potential problems.Fc             C   sj   |j dddd� |j ddddd	d
� |j ddddd
� |j ddddd
� |j dddddddgddd� 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_trueÚ	list_tagszList available tags.z--deployÚdeployzCheck deployment settings.z--fail-levelÚERRORÚCRITICALÚWARNINGÚINFOÚDEBUGÚ
fail_levelz[Message level that will cause the command to exit with a non-zero status. Default is ERROR.)ÚdefaultÚchoicesr   r   )Úadd_argument)ÚselfÚparser© r    úiC:\Users\HIRONO~1\AppData\Local\Temp\pip-install-6bm3nxem\django\django\core\management\commands\check.pyÚadd_arguments   s     zCommand.add_argumentsc          	      s²   |d ‰ |d r0| j  d tt ˆ ¡ƒ¡¡ d S |rDdd„ |D ƒ}nd }|d }|r�yt‡ fdd„|D ƒƒ}W n tk
r‚   Y nX td	| ƒ‚| j	||d
ˆ t
t|d ƒd� d S )Nr   r   Ú
c             S   s   g | ]}t  |¡‘qS r    )r   Zget_app_config)Ú.0r	   r    r    r!   ú
<listcomp>,   s    z"Command.handle.<locals>.<listcomp>r   c             3   s   | ]}t  |ˆ ¡s|V  qd S )N)r   Z
tag_exists)r$   Útag)Úinclude_deployment_checksr    r!   ú	<genexpr>4   s    z!Command.handle.<locals>.<genexpr>z+There is no system check with the "%s" tag.Tr   )Úapp_configsr   Zdisplay_num_errorsr'   r   )ÚstdoutÚwriteÚjoinÚsortedr   Ztags_availableÚnextÚStopIterationr   ÚcheckÚgetattrr   )r   Z
app_labelsÚoptionsr)   r   Zinvalid_tagr    )r'   r!   Úhandle%   s*    zCommand.handleN)Ú__name__Ú
__module__Ú__qualname__r   Zrequires_system_checksr"   r3   r    r    r    r!   r      s   r   N)
Zdjango.appsr   Zdjango.corer   Zdjango.core.checks.registryr   Zdjango.core.management.baser   r   r   r    r    r    r!   Ú<module>   s   