ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ Yc@sdZddlZddlZddlmZmZddlmZmZddl m Z ddl m Z m Z mZyddlmZWnek rdZnXy ddUWn-ek rd Znek rd ZnXd efd YZd ZdefdYZddZddZddZdZdZdZdZ edkry eZ WnnX[ndS(sQ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. iN(t TracebackTypetCodeType(tmissingt internal_code(tTemplateSyntaxError(t iteritemstreraisetPY2(ttproxysraise TypeError, 'foo'sraise __jinja_exception__[1]s4raise __jinja_exception__[0], __jinja_exception__[1]tTracebackFrameProxycBsGeZdZdZedZdZedZdZRS(sProxies a traceback frame.cCs||_d|_dS(N(ttbtNonet_tb_next(tselfR ((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyt__init__'s cCs|jS(N(R (R ((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyttb_next+scCsStdk rFy#t|j|r'|jp*dWqFtk rBqFXn||_dS(N(t tb_set_nextR R t ExceptionR (R tnext((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytset_next/s  # cCsd|jjjkS(Nt__jinja_template__(R ttb_framet f_globals(R ((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytis_jinja_frame:scCst|j|S(N(tgetattrR (R tname((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyt __getattr__>s( t__name__t __module__t__doc__RtpropertyRRRR(((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyR $s   cs8t|tdkrSfd}tt|S(NcsV|dkrt|dS|dkr<j||nt|||SdS(Nt__getattribute__Rit __setattr__(RR(RR (t operationtargstkwargs(tproxy(s0/usr/lib/python2.7/site-packages/jinja2/debug.pytoperation_handlerFs   (R RR R(tframeR%((R$s0/usr/lib/python2.7/site-packages/jinja2/debug.pytmake_frame_proxyBs   tProcessedTracebackcBs\eZdZdZddZedZedZ edZ edZ RS(s?Holds a Jinja preprocessed traceback for printing or reraising.cCsz|std||_||_||_d}x3|jD](}|dk r_|j|n|}q=W|jddS(Nsno frames for this traceback?(tAssertionErrortexc_typet exc_valuetframesR R(R R*R+R,tprev_tbR ((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyRSs     cCs;tj|j|j|jdd|}dj|jS(s#Return a string with the traceback.itlimitt(t tracebacktformat_exceptionR*R+R,tjointrstrip(R R.tlines((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytrender_as_textascCs<ddlm}d||d||jjddfS(s<Return a unicode string with the traceback as rendered HTML.i(trender_tracebacku%s tfullsutf-8treplace(tjinja2.debugrendererR6R5tdecode(R R7R6((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytrender_as_htmlgscCst|jtS(s*`True` if this is a template syntax error.(t isinstanceR+R(R ((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytis_template_syntax_erroroscCs|j|j|jdfS(s;Exception info tuple with a proxy around the frame objects.i(R*R+R,(R ((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytexc_infotscCs>|jd}t|tk r+|j}n|j|j|fS(s'Standard python exc_info for re-raisingi(R,ttypeRR R*R+(R R ((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytstandard_exc_infoys  N( RRRRR R5tFalseR;RR=R>R@(((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyR(Ps   cCsI|\}}}t|tr6t||}d}nd}t||S(s7Creates a processed traceback object from the exc_info.ii(R<Rttranslate_syntax_errorttranslate_exception(R>t source_hintR*R+R t initial_skip((s0/usr/lib/python2.7/site-packages/jinja2/debug.pytmake_tracebacks  cCsU||_t|_|j|df}|j}|dkrBd}nt|||jS(s4Rewrites a syntax error to please traceback systems.s N(tsourcetTruet translatedt __class__R tfilenamet fake_exc_infotlineno(terrorRGR>RK((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyRBs     ic Cs2|d}g}x,t|D]}|dk r|j}qqW|}x|dk r|jjtkru|j}qHn|j}|jjjd}|dk r|j|j }t |d |f|j |d}n|j t ||}qHW|st|d|d|dnt|d|d|S(sIf passed an exc_info it will automatically rewrite the exceptions all the way down to the correct line numbers and frames. iRiiN(trangeR RRtf_codeRRtgettget_corresponding_linenot tb_linenoRLRKtappendR'RR(( R>RER R,txt initial_tbRttemplateRM((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyRCs*      c Cs<|jd}|r*|jj}ni}i}xt|D]\}}|jd sC|tkrqqCny+|jdd\}}}t|}Wntk rqCnX|j|dd}||krC||f||R( R>RKRMR*R+R Rdtglobalstcodetlocationtfunctiontetnew_tb((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyRLsP            csyddlddlmtrLtjdr@j}qUj}n j}dj fdY}d|fdj |fg|_ tt d rdj fd Y}d j |fd j |fd|fdj |fg|_ nd |fdYdj fdj |fdjfdjfg_ fd}|S(sThis function implements a few ugly things so that we can patch the traceback objects. The function returned allows resetting `tb_next` on any python traceback object. Do not attempt to use this on non cpython interpreters iN(RtPy_InitModule4_64t _PyObjectcBseZRS((RR(((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyR>st ob_refcnttob_typet getobjectscBseZRS((RR(((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyRGst_ob_nextt_ob_prevt _TracebackcBseZRS((RR(((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyRPsRRttb_lastiRScst|o'|dkp't|s9tdnjt|}|jdk rjt|j}|jd8_n|dkrj|_n6jt|}|jd7_j||_dS(s0Set the tb_next attribute of a traceback object.s/tb_set_next arguments must be traceback objectsiN( R<R t TypeErrort from_addresstidRRtPOINTERtpointer(R Rtobjtold(RRtctypes(s0/usr/lib/python2.7/site-packages/jinja2/debug.pyRYs ( RttypesRRthasattrt pythonapitc_int64tc_intt c_ssize_tt StructureRt_fields_R}(t _Py_ssize_tRR((RRRs0/usr/lib/python2.7/site-packages/jinja2/debug.pyt_init_ugly_crap*s.       (!RR}R0RRRt jinja2.utilsRRtjinja2.exceptionsRtjinja2._compatRRRt__pypy__Rt ImportErrorR t SyntaxErrorRqRtobjectR R'R(RFRBRCRiRLRR(((s0/usr/lib/python2.7/site-packages/jinja2/debug.pyt s@          4 ,  F D