
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
aG‘\L  ã               @   s¼   d Z ddlmZmZmZmZ G dd„ deƒZeG dd„ dee	eƒƒZ
G dd„ de
ƒZeG d	d
„ d
eƒƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )z¢
    jinja2.exceptions
    ~~~~~~~~~~~~~~~~~

    Jinja exceptions.

    :copyright: (c) 2017 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
é    )ÚimapÚ	text_typeÚPY2Úimplements_to_stringc               @   sJ   e Zd ZdZer0ddd„Zedd„ ƒZdd„ Zndd	d„Zed
d„ ƒZdS )ÚTemplateErrorz"Baseclass for all template errors.Nc             C   s&   |d k	rt |ƒjdƒ}tj| |ƒ d S )Nzutf-8)r   ÚencodeÚ	ExceptionÚ__init__)ÚselfÚmessage© r   ú /usr/lib/python3.6/exceptions.pyr	      s    zTemplateError.__init__c             C   s(   | j r$| j d }|d k	r$|jddƒS d S )Nr   zutf-8Úreplace)ÚargsÚdecode)r
   r   r   r   r   r      s    
zTemplateError.messagec             C   s
   | j pdS )NÚ )r   )r
   r   r   r   Ú__unicode__   s    zTemplateError.__unicode__c             C   s   t j| |ƒ d S )N)r   r	   )r
   r   r   r   r   r	   !   s    c             C   s    | j r| j d }|d k	r|S d S )Nr   )r   )r
   r   r   r   r   r   $   s    
)N)N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   Úpropertyr   r   r   r   r   r   r      s   


r   c               @   s&   e Zd ZdZdZddd„Zdd„ ZdS )ÚTemplateNotFoundz$Raised if a template does not exist.Nc             C   s.   t j| ƒ |d kr|}|| _|| _|g| _d S )N)ÚIOErrorr	   r   ÚnameÚ	templates)r
   r   r   r   r   r   r	   4   s    
zTemplateNotFound.__init__c             C   s   | j S )N)r   )r
   r   r   r   Ú__str__<   s    zTemplateNotFound.__str__)N)r   r   r   r   r   r	   r   r   r   r   r   r   ,   s   
r   c               @   s   e Zd ZdZf dfdd„ZdS )ÚTemplatesNotFoundzæLike :class:`TemplateNotFound` but raised if multiple templates
    are selected.  This is a subclass of :class:`TemplateNotFound`
    exception, so just catching the base exception will catch both.

    .. versionadded:: 2.2
    Nc             C   sD   |d krddj tt|ƒƒ }tj| |r.|d p0d |ƒ t|ƒ| _d S )Nz(none of the templates given were found: z, é   éÿÿÿÿ)Újoinr   r   r   r	   Úlistr   )r
   Únamesr   r   r   r   r	   H   s
    zTemplatesNotFound.__init__)r   r   r   r   r	   r   r   r   r   r   @   s   r   c               @   s"   e Zd ZdZddd„Zdd„ ZdS )ÚTemplateSyntaxErrorzBRaised to tell the user that there is a problem with the template.Nc             C   s.   t j| |ƒ || _|| _|| _d | _d| _d S )NF)r   r	   Úlinenor   ÚfilenameÚsourceÚ
translated)r
   r   r$   r   r%   r   r   r   r	   T   s    zTemplateSyntaxError.__init__c             C   sœ   | j r| jS d| j }| jp | j}|r2d||f }| jd| g}| jd k	r’y| jjƒ | jd  }W n tk
rz   d }Y nX |r’|jd|j	ƒ  ƒ dj
|ƒS )Nzline %dzFile "%s", %sz  r   z    Ú
)r'   r   r$   r%   r   r&   Ú
splitlinesÚ
IndexErrorÚappendÚstripr    )r
   Úlocationr   ÚlinesÚliner   r   r   r   _   s    


zTemplateSyntaxError.__str__)NN)r   r   r   r   r	   r   r   r   r   r   r#   P   s   
r#   c               @   s   e Zd ZdZdS )ÚTemplateAssertionErrora  Like a template syntax error, but covers cases where something in the
    template caused an error at compile time that wasn't necessarily caused
    by a syntax error.  However it's a direct subclass of
    :exc:`TemplateSyntaxError` and has the same attributes.
    N)r   r   r   r   r   r   r   r   r0   w   s   r0   c               @   s   e Zd ZdZdS )ÚTemplateRuntimeErrorzoA generic runtime error in the template engine.  Under some situations
    Jinja may raise this exception.
    N)r   r   r   r   r   r   r   r   r1      s   r1   c               @   s   e Zd ZdZdS )ÚUndefinedErrorz<Raised if a template tries to operate on :class:`Undefined`.N)r   r   r   r   r   r   r   r   r2   …   s   r2   c               @   s   e Zd ZdZdS )ÚSecurityErrorzWRaised if a template tries to do something insecure if the
    sandbox is enabled.
    N)r   r   r   r   r   r   r   r   r3   ‰   s   r3   c               @   s   e Zd ZdZdS )ÚFilterArgumentErrorzQThis error is raised if a filter was called with inappropriate
    arguments
    N)r   r   r   r   r   r   r   r   r4   �   s   r4   N)r   Zjinja2._compatr   r   r   r   r   r   r   ÚLookupErrorr   r   r#   r0   r1   r2   r3   r4   r   r   r   r   Ú<module>
   s   &