o
    lf                     @   sr   d dl Z d dlmZ d dlmZ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G d
d de jZdS )    N)ImproperlyConfigured)OriginTemplateDoesNotExistconditional_escape   )
BaseEngine)csrf_input_lazycsrf_token_lazyc                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )TemplateStringstemplate_stringsc                    s>   |  }|d  }|rtdd|t | d S )NOPTIONSzUnknown options: {}z, )copypopr   formatjoinsuper__init__)selfparamsoptions	__class__ b/var/www/ticemtrilhas/avaliacao_env/lib/python3.10/site-packages/django/template/backends/dummy.pyr      s
   zTemplateStrings.__init__c                 C   s   t |S )N)Template)r   template_coder   r   r   from_string   s   zTemplateStrings.from_stringc              
   C   s   g }|  |D ]8}zt|dd}| }W d    n1 sw   Y  W n ty9   |t||| df Y qw t|  S t||| d)Nzutf-8)encodingzSource does not exist)triedbackend)iter_template_filenamesopenreadFileNotFoundErrorappendr   r   r   )r   template_namer   template_filefpr   r   r   r   get_template   s    

zTemplateStrings.get_template)__name__
__module____qualname__app_dirnamer   r   r)   __classcell__r   r   r   r   r      s
    r   c                   @   s   e Zd ZdddZdS )r   Nc                 C   sJ   |d u ri }n	dd |  D }|d ur t||d< t||d< | |S )Nc                 S   s   i | ]	\}}|t |qS r   r   ).0kvr   r   r   
<dictcomp>/   s    z#Template.render.<locals>.<dictcomp>
csrf_input
csrf_token)itemsr	   r
   safe_substitute)r   contextrequestr   r   r   render+   s   
zTemplate.render)NN)r*   r+   r,   r9   r   r   r   r   r   *   s    r   )stringdjango.core.exceptionsr   django.templater   r   django.utils.htmlr   baser   utilsr	   r
   r   r   r   r   r   r   <module>   s    