
    g                     R    d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z
  G d de
      Z	y	)
z4
Wrapper for loading templates from the filesystem.
    )SuspiciousFileOperation)OriginTemplateDoesNotExist)	safe_join   )Loaderc                   2     e Zd Zd fd	Zd Zd Zd Z xZS )r   c                 2    t         |   |       || _        y N)super__init__dirs)selfenginer   	__class__s      z/var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/template/loaders/filesystem.pyr   zLoader.__init__   s     	    c                 ^    | j                   | j                   S | j                  j                   S r   )r   r   )r   s    r   get_dirszLoader.get_dirs   s$     II1tyyGt{{7G7GGr   c                     	 t        |j                  | j                  j                        5 }|j	                         cd d d        S # 1 sw Y   y xY w# t
        $ r t        |      w xY w)N)encoding)opennamer   file_charsetreadFileNotFoundErrorr   )r   originfps      r   get_contentszLoader.get_contents   sP    	/fkkDKK,D,DEwwy FEE  	/&v..	/s'   +A A	A AA A A(c              #      K   | j                         D ]  }	 t        ||      }t        |||        ! y# t        $ r Y .w xY ww)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!   template_dirr   s       r   get_template_sourceszLoader.get_template_sources   sV      !MMOL }= +  , +  s$   A6A	AAAAr   )__name__
__module____qualname__r   r   r   r$   __classcell__)r   s   @r   r   r      s    H/r   r   N)__doc__django.core.exceptionsr   django.templater   r   django.utils._osr   baser   
BaseLoader r   r   <module>r0      s$    ; 8 & &!Z !r   