HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/django/template/__pycache__/utils.cpython-310.pyc
o

�h*�@s�ddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZGd	d
�d
e
�ZGdd�d�Zejd
d��ZdS)�N)�Counter)�Path)�apps)�settings)�ImproperlyConfigured)�cached_property)�
import_stringc@seZdZdS)�InvalidTemplateEngineErrorN)�__name__�
__module__�__qualname__�r
r
�H/usr/local/CyberCP/lib/python3.10/site-packages/django/template/utils.pyr	sr	c@s:eZdZddd�Zedd��Zdd�Zdd	�Zd
d�ZdS)
�
EngineHandlerNcCs||_i|_dS)z|
        templates is an optional list of template engine definitions
        (structured like settings.TEMPLATES).
        N)�
_templates�_engines)�self�	templatesr
r
r�__init__s
zEngineHandler.__init__c	Cs�|jdur	tj|_i}g}|jD]9}z|d�dd�d}Wnty2|�dd�}td�|���w|gdid�|�}|||d	<|�|d	�qt	|�}d
d�|�
�D�}|rctd�d
�|����|S)N�BACKEND�.����z
<not defined>zHInvalid BACKEND for a template engine: {}. Check your TEMPLATES setting.F)�NAME�DIRS�APP_DIRS�OPTIONSrcSsg|]
\}}|dkr|�qS)�r
)�.0�alias�countr
r
r�
<listcomp>8sz+EngineHandler.templates.<locals>.<listcomp>zoTemplate engine aliases aren't unique, duplicates: {}. Set a unique NAME for each engine in settings.TEMPLATES.z, )rr�	TEMPLATES�rsplit�	Exception�getr�format�appendr�most_common�join)rr�
backend_names�tpl�default_name�invalid_backend�counts�
duplicatesr
r
rrsB

������zEngineHandler.templatescCs|z|j|WSty=z|j|}Wnty"td�|���w|��}|�d�}t|�}||�}||j|<|YSw)Nz4Could not find config for '{}' in settings.TEMPLATESr)r�KeyErrorrr	r&�copy�popr)rr�params�backend�
engine_cls�enginer
r
r�__getitem__Cs$��	

�zEngineHandler.__getitem__cCs
t|j�S�N)�iterr�rr
r
r�__iter__Zs
zEngineHandler.__iter__cs�fdd��D�S)Ncsg|]}�|�qSr
r
)rrr:r
rr!^sz%EngineHandler.all.<locals>.<listcomp>r
r:r
r:r�all]szEngineHandler.allr8)	r
rrrrrr7r;r<r
r
r
rrs

)rcs�fdd�t��D�}t|�S)z�
    Return an iterable of paths of directories to load app templates from.

    dirname is the name of the subdirectory containing templates inside
    installed applications.
    cs2g|]}|jrt|j����rt|j���qSr
)�pathr�is_dir)r�
app_config��dirnamer
rr!is���z)get_app_template_dirs.<locals>.<listcomp>)r�get_app_configs�tuple)rA�
template_dirsr
r@r�get_app_template_dirsas
�rE)�	functools�collectionsr�pathlibr�django.appsr�django.confr�django.core.exceptionsr�django.utils.functionalr�django.utils.module_loadingrr	r�	lru_cacherEr
r
r
r�<module>sQ