U
    mf                     @   s   d dl Z d dlmZ d dlmZ d dlmZ ddlmZm	Z	m
Z
mZ eddd	Zed
dd	Ze
ddd	Zee	jdd Zee	jdd Zee	jdd ZdS )    N)defaultdict)settings)get_template_tag_modules   )ErrorTagsWarningregisterzYou have 'APP_DIRS': True in your TEMPLATES but also specify 'loaders' in OPTIONS. Either remove APP_DIRS or remove the 'loaders' option.ztemplates.E001idzK'string_if_invalid' in TEMPLATES OPTIONS must be a string but got: {} ({}).ztemplates.E002z0{} is used for multiple template tag modules: {}ztemplates.E003c                 K   s   t dd tjD rtgS g S )Nc                 s   s(   | ] }| d od| di kV  qdS )ZAPP_DIRSloadersOPTIONSN)get).0conf r   @/tmp/pip-unpacked-wheel-siwebuq3/django/core/checks/templates.py	<genexpr>   s   z1check_setting_app_dirs_loaders.<locals>.<genexpr>)anyr   	TEMPLATESE001)app_configskwargsr   r   r   check_setting_app_dirs_loaders   s    r   c                 K   s\   g }t jD ]L}|di dd}t|ts
tt}|j|t	|j
|_|| q
|S )Nr   string_if_invalid )r   r   r   
isinstancestrcopyE002msgformattype__name__append)r   r   errorsr   r   errorr   r   r   !check_string_if_invalid_is_string$   s    


 r'   c           
      K   s   g }t t}tjD ]8}|di di }| D ]\}}|| | q2qt D ]\}}|| | qR| D ]J\}}	t|	dkrr|	t
tjt|ddd t|	D tjd qr|S )Nr   	librariesr   z, c                 s   s   | ]}t |V  qd S )N)repr)r   itemr   r   r   r   E   s     z=check_for_template_tags_with_the_same_name.<locals>.<genexpr>r
   )r   setr   r   r   itemsaddr   lenr$   r   W003r    r!   r)   joinsortedr   )
r   r   r%   r(   r   Zcustom_librariesmodule_namemodule_pathZlibrary_namer,   r   r   r   *check_for_template_tags_with_the_same_name2   s(    

r4   )r   collectionsr   Zdjango.confr   Zdjango.template.backends.djangor   r   r   r   r   r	   r   r   r/   Z	templatesr   r'   r4   r   r   r   r   <module>   s,   

