OwlCyberSecurity - MANAGER
Edit File: filesystem.cpython-39.pyc
a ���e� � @ sL d Z ddlmZ ddlmZmZ ddlmZ ddlm Z G dd� de �Z d S ) z4 Wrapper for loading templates from the filesystem. � )�SuspiciousFileOperation)�Origin�TemplateDoesNotExist)� safe_join� )�Loaderc s6 e Zd Zd � fdd� Zdd� Zdd� Zdd � Z� ZS )r Nc s t � �|� || _d S �N)�super�__init__�dirs)�self�enginer �� __class__� �c/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/template/loaders/filesystem.pyr s zLoader.__init__c C s | j d ur| j S | jj S r )r r )r r r r �get_dirs s zLoader.get_dirsc C s` z@t |j| jjd��}|�� W d � W S 1 s40 Y W n tyZ t|��Y n0 d S )N)�encoding)�open�namer Zfile_charset�read�FileNotFoundErrorr )r �origin�fpr r r �get_contents s ,zLoader.get_contentsc c sH | � � D ]:}zt||�}W n ty0 Y qY n0 t||| d�V qdS )z� Return an Origin object pointing to an absolute path in each directory in template_dirs. For security reasons, if a path doesn't lie inside one of the template_dirs it is excluded from the result set. )r � template_name�loaderN)r r r r )r r Ztemplate_dirr r r r �get_template_sources s �zLoader.get_template_sources)N)�__name__� __module__�__qualname__r r r r � __classcell__r r r r r s r N)�__doc__Zdjango.core.exceptionsr Zdjango.templater r Zdjango.utils._osr �baser Z BaseLoaderr r r r �<module> s