U a@sddlZejrddlmZGdddeZGdddeeeZ Gdd d e Z Gd d d eZ Gd d d e Z GdddeZ Gddde ZGddde ZGddde ZdS)N UndefinedcsHeZdZdZd ejeddfdd ZeejedddZ Z S) TemplateErrorz"Baseclass for all template errors.N)messagereturncst|dSN)super__init__)selfr __class__RC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-8gbwd15f\jinja2\exceptions.pyr szTemplateError.__init__rcCs|jr|jdSdS)Nr)argsr rrrr szTemplateError.message)N) __name__ __module__ __qualname____doc__tOptionalstrr propertyr __classcell__rrr rrsrc@s\eZdZUdZdZejeed<d ejej edfejeddddZ edd d Z dS) TemplateNotFoundzRaised if a template does not exist. .. versionchanged:: 2.11 If the given name is :class:`Undefined` and no message was provided, an :exc:`UndefinedError` is raised. Nrr)namerrcCsNt|||dkr6ddlm}t||r2||}||_||_|g|_dS)Nrr) IOErrorr runtimer isinstanceZ_fail_with_undefined_errorrr templates)r rrrrrrr s   zTemplateNotFound.__init__rcCs t|jSr)rrrrrr__str__1szTemplateNotFound.__str__)N) rrrrrrrr__annotations__Unionr r"rrrrrs   rcsBeZdZdZdejejedfejeddfdd Z Z S) TemplatesNotFoundaLike :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. .. versionchanged:: 2.11 If a name in the list of names is :class:`Undefined`, a message about it being undefined is shown rather than the empty string. .. versionadded:: 2.2 rNr)namesrrcs|dkr^ddlm}g}|D]&}t||r8||jq||qdtt|}d|}t |rp|dnd|t ||_ dS)Nrrz, z(none of the templates given were found: ) rrr appendZ_undefined_messagejoinmaprr r listr!)r r&rrpartsrZ parts_strr rrr As    zTemplatesNotFound.__init__)rN) rrrrrSequencer$rrr rrrr rr%5s r%csReZdZdZd eeejeejeddfdd ZedddZ d d Z Z S) TemplateSyntaxErrorzBRaised to tell the user that there is a problem with the template.N)rlinenorfilenamercs.t|||_||_||_d|_d|_dS)NF)r r r/rr0source translated)r rr/rr0r rrr [s  zTemplateSyntaxError.__init__rcCs|jrtt|jSd|j}|jp*|j}|r@d|d|}tt|jd|g}|jdk rz|j |jd}Wnt k rYnX| d| d |S)Nzline zFile "z", z rz  )r2rcastrrr/r0rr1 splitlines IndexErrorr(stripr))r locationrlineslinerrrr"ls   zTemplateSyntaxError.__str__cCs|j|j|j|j|jffSr)r rr/rr0rrrr __reduce__szTemplateSyntaxError.__reduce__)NN) rrrrrintrrr r"r;rrrr rr.Xsr.c@seZdZdZdS)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. Nrrrrrrrrr=sr=c@seZdZdZdS)TemplateRuntimeErrorzoA generic runtime error in the template engine. Under some situations Jinja may raise this exception. Nr>rrrrr?sr?c@seZdZdZdS)UndefinedErrorzrrrrr@sr@c@seZdZdZdS) SecurityErrorzWRaised if a template tries to do something insecure if the sandbox is enabled. Nr>rrrrrAsrAc@seZdZdZdS)FilterArgumentErrorzQThis error is raised if a filter was called with inappropriate arguments Nr>rrrrrBsrB)typingr TYPE_CHECKINGrr Exceptionrr LookupErrorrr%r.r=r?r@rArBrrrrs  ##3