ó ,òQc@sdZddlmZmZmZmZdefd„ƒYZedee efd„ƒYƒZ de fd„ƒYZ ed efd „ƒYƒZ d e fd „ƒYZ d efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(s¢ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. iÿÿÿÿ(timapt text_typetPY2timplements_to_stringt TemplateErrorcBsVeZdZer9dd„Zed„ƒZd„Zndd„Zed„ƒZRS(s"Baseclass for all template errors.cCs8|dk r$t|ƒjdƒ}ntj||ƒdS(Nsutf-8(tNoneRtencodet Exceptiont__init__(tselftmessage((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyRs cCs9|jr5|jd}|dk r5|jddƒSndS(Nisutf-8treplace(targsRtdecode(R R ((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR s   cCs |jp dS(Nu(R (R ((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyt __unicode__scCstj||ƒdS(N(RR(R R ((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR!scCs-|jr)|jd}|dk r)|SndS(Ni(R R(R R ((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR $s   N( t__name__t __module__t__doc__RRRtpropertyR R(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyRs   tTemplateNotFoundcBs)eZdZdZdd„Zd„ZRS(s$Raised if a template does not exist.cCsDtj|ƒ|dkr"|}n||_||_|g|_dS(N(tIOErrorRRR tnamet templates(R RR ((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR4s      cCs|jS(N(R (R ((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyt__str__<sN(RRRRR RR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR,s tTemplatesNotFoundcBseZdZddd„ZRS(sæ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 cCsa|dkr+ddjtt|ƒƒ}ntj||rD|dpGd|ƒt|ƒ|_dS(Nu(none of the templates given were found: u, iÿÿÿÿ(RtjoinRRRRtlistR(R tnamesR ((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyRHs  #(N(RRRRR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR@stTemplateSyntaxErrorcBs&eZdZddd„Zd„ZRS(sBRaised to tell the user that there is a problem with the template.cCsAtj||ƒ||_||_||_d|_t|_dS(N( RRtlinenoRtfilenameRtsourcetFalset translated(R R RRR((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyRTs     cCsÒ|jr|jSd|j}|jp,|j}|rHd||f}n|jd|g}|jdk rÅy|jjƒ|jd}Wntk r¡d}nX|rÅ|j d|j ƒƒqÅndj |ƒS(Nsline %ds File "%s", %ss is u ( R!R RRRRRt splitlinest IndexErrortappendtstripR(R tlocationRtlinestline((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR_s    N(RRRRRR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyRPs tTemplateAssertionErrorcBseZdZRS(s 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. (RRR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR)wstTemplateRuntimeErrorcBseZdZRS(soA generic runtime error in the template engine. Under some situations Jinja may raise this exception. (RRR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR*stUndefinedErrorcBseZdZRS(s<Raised if a template tries to operate on :class:`Undefined`.(RRR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR+…st SecurityErrorcBseZdZRS(sWRaised if a template tries to do something insecure if the sandbox is enabled. (RRR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR,‰stFilterArgumentErrorcBseZdZRS(sQThis error is raised if a filter was called with inappropriate arguments (RRR(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyR-sN(Rtjinja2._compatRRRRRRRt LookupErrorRRRR)R*R+R,R-(((s5/usr/lib/python2.7/site-packages/jinja2/exceptions.pyt s"&