Ñò -!Lc@s!ddkZeedeƒp eidjZeidjo eidjZeiidƒZeiid ƒZ eodd k l Z n/ydd k l Z Wndd k l Z nXddk Z ddkZddkZddkZddkZddkZyddkZddkZWn+ej oddkZddkZnXe peo eiZn eiZd „Zeo d „Zn d „Zd„Zdd„Zdefd„ƒYZ de!fd„ƒYZ"defd„ƒYZ#ei$dei%ƒZ&d„Z'd„Z(d„Z)dS(iÿÿÿÿNt py3kwarningiiiiitjavatwin(tStringIOcCs ||_|S(sÈReturn a function with a given __name__. Will assign to __name__ and return the original function if possible on the Python implementation, otherwise a new function will be constructed. (t__name__(tfntname((s-/usr/lib/python2.6/site-packages/mako/util.pytfunction_named%s cCs,y|iiSWntj o |iSXdS(N(t __class__RtAttributeError(texc((s-/usr/lib/python2.6/site-packages/mako/util.pytexception_name0scCs |iiS(N(RR(R ((s-/usr/lib/python2.6/site-packages/mako/util.pyR 6scCsad}xTtii|ƒp@y|d7}ti|dƒWq |djo‚qXq Xq WdS(s,create and/or verify a filesystem directory.iiiýiN(tostpathtexiststmakedirs(tdirttries((s-/usr/lib/python2.6/site-packages/mako/util.pytverify_directory9s  cCs8|djo|St|ttfƒp|gS|SdS(N(tNonet isinstancetlistttuple(txtdefault((s-/usr/lib/python2.6/site-packages/mako/util.pytto_listFs  t SetLikeDictcBseZdZd„ZRS(s0a dictionary that has some setlike methods on itcCst|}|i|ƒ|S(sproduce a 'union' of this dict and another (at the key level). values in the second dict take precedence over that of the first(Rtupdate(tselftotherR((s-/usr/lib/python2.6/site-packages/mako/util.pytunionTs  (Rt __module__t__doc__R(((s-/usr/lib/python2.6/site-packages/mako/util.pyRRstFastEncodingBuffercBs2eZdZdded„Zd„Zd„ZRS(sma very rudimentary buffer that is faster than StringIO, but doesnt crash on unicode data like cStringIO.tstrictcCsTg|_||_|o d|_n d|_||_||_|ii|_dS(Nut(tdatatencodingtdelimtunicodeterrorstappendtwrite(RR%R(R'((s-/usr/lib/python2.6/site-packages/mako/util.pyt__init__`s      cCs g|_dS(N(R$(R((s-/usr/lib/python2.6/site-packages/mako/util.pyttruncatekscCsG|io&|ii|iƒi|i|iƒS|ii|iƒSdS(N(R%R&tjoinR$tencodeR((R((s-/usr/lib/python2.6/site-packages/mako/util.pytgetvaluens &N(RRR RtFalseR+R,R/(((s-/usr/lib/python2.6/site-packages/mako/util.pyR!\s tLRUCachecBs]eZdZdefd„ƒYZdd„Zd„Zd„Zd„Zd„Z d „Z RS( s)A dictionary-like object that stores a limited number of items, discarding lesser used items periodically. this is a rewrite of LRUCache from Myghty to use a periodic timestamp-based paradigm so that synchronization is not really needed. the size management is inexact. t_ItemcBseZd„Zd„ZRS(cCs"||_||_tƒ|_dS(N(tkeytvaluet time_funct timestamp(RR3R4((s-/usr/lib/python2.6/site-packages/mako/util.pyR+~s  cCs t|iƒS(N(treprR4(R((s-/usr/lib/python2.6/site-packages/mako/util.pyt__repr__‚s(RRR+R8(((s-/usr/lib/python2.6/site-packages/mako/util.pyR2}s gà?cCs||_||_dS(N(tcapacityt threshold(RR9R:((s-/usr/lib/python2.6/site-packages/mako/util.pyR+…s cCs%ti||ƒ}tƒ|_|iS(N(tdictt __getitem__R5R6R4(RR3titem((s-/usr/lib/python2.6/site-packages/mako/util.pyR<‰s cCs+g}ti|ƒD]}||iq~S(N(R;tvaluesR4(Rt_[1]ti((s-/usr/lib/python2.6/site-packages/mako/util.pyR>ŽscCs(||jo ||S|||<|SdS(N((RR3R4((s-/usr/lib/python2.6/site-packages/mako/util.pyt setdefault‘s   cCs_ti||ƒ}|djo)|i||ƒ}ti|||ƒn ||_|iƒdS(N(R;tgetRR2t __setitem__R4t _manage_size(RR3R4R=((s-/usr/lib/python2.6/site-packages/mako/util.pyRC˜s   cCs—xt|ƒ|i|i|ijoktti|ƒdtidƒdtƒ}x:||iD]+}y||i =Wq_t j oPq_Xq_WqWdS(NR3R6treverse( tlenR9R:tsortedR;R>toperatort attrgettertTrueR3tKeyError(RtbytimeR=((s-/usr/lib/python2.6/site-packages/mako/util.pyRD¡s$( RRR tobjectR2R+R<R>RARCRD(((s-/usr/lib/python2.6/site-packages/mako/util.pyR1ts     s([ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)c Cs9|iƒ}|idƒz |iƒ}|itiƒ}|o|ttiƒ}nti|i ddƒƒ}|ppy)ddk }|i |i ddƒƒWnt t fj oqêX|iƒ}ti|i ddƒƒ}n|o|o t d‚ndS|o|idƒSdSWd|i|ƒXdS( sDeduce the encoding of a Python source file (binary mode) from magic comment. It does this in the same way as the `Python interpreter`__ .. __: http://docs.python.org/ref/encodings.html The ``fp`` argument should be a seekable file object in binary mode. itasciitignoreiÿÿÿÿNs\python refuses to compile code with both a UTF8 byte-order-mark and a magic encoding commenttutf_8i(ttelltseektreadlinet startswithtcodecstBOM_UTF8RFt_PYTHON_MAGIC_COMMENT_retmatchtdecodetparsertsuitet ImportErrort SyntaxErrortgroupR(tfptpostline1thas_bomtmRZtline2((s-/usr/lib/python2.6/site-packages/mako/util.pytparse_encoding²s2      c CsT|iƒ}|iƒddig}|D]}|d|||fq*~ƒdS(sƒrepr() a dictionary with the keys in order. Used by the lexer unit test to compare parse trees based on strings. t{s, s%r: %rt}(tkeystsortR-(tdRhR?tk((s-/usr/lib/python2.6/site-packages/mako/util.pytsorted_dict_reprßs  cCsÙt|dƒodSd|_tddd|iƒ}t|ƒ|_xN|iiD]@}|idjo ||_qR|idjo ||_qRqRWt|i d ƒ|_ t|i d ƒ|_ t|i dƒ|_ t|i d i d ƒ|_t|i d i d iƒ|_t|i d iƒ|_t|i d iiƒ|_t|i d iiiƒ|_t|i d iiiƒ|_t|i d iiiiƒ|_t|i d iiƒ|_t|i d iiiƒ|_t|i d iiiiƒ|_t|i d iiiiiƒ|_t|i diiƒ|_t|i diiiƒ|_t|i diiiiƒ|_ t|i diiƒ|_!t|i dii"d iƒ|_#t|i diiiƒ|_$t|i diiiiƒ|_%t|i diiii&iƒ|_'t|i diiiiƒ|_(t|i diiƒ|_!t|i dii"d iƒ|_#t|i dii)d ƒ|_*t|i dii)d ƒ|_+t|i diii)d ƒ|_,t|i diii)d ƒ|_-t|i dii)d ƒ|_.t|i dii)d ƒ|_/t|i dii)dƒ|_0t|i dii)d ƒ|_1t|i dii)d ƒ|_2t|i dii)d ƒ|_3dS(sdAttempt to restore the required classes to the _ast module if it appears to be missing them tASTNii sdef foo(): pass class Bar(object): pass if False: pass baz = 'mako' 1 + 2 - 3 * 4 / 5 6 // 7 % 8 << 9 >> 10 11 & 12 ^ 13 | 14 15 and 16 or 17 -baz + (not +18) - ~17 baz and 'foo' or 'bar' (mako is baz == baz) is not baz != mako mako > baz < mako >= baz <= mako mako in baz not in makos texectmodiiiiiiiii i i i(4thasattrt PyCF_ONLY_ASTtcompilettypetModulet__mro__RRoRmtbodyt FunctionDeftClassDeftIfttargetstNametctxtStoreR4tStrtoptSubtlefttAddtrighttDivtMulttRShifttLShifttModtFloorDivtBitOrtBitXortBitAndtOrR>tAndtInverttNottoperandtUAddtUSubtopstIsNottNotEqtIstEqtGttLttGtEtLtEtIntNotIn(t_astRctcls((s-/usr/lib/python2.6/site-packages/mako/util.pyt restore__astés^     ""%"#"%"#  ##     (ii(ii(ii(*tsystgetattrR0t version_infotpy3ktpy24tplatformRTtjythontwin32tioRt cStringIORUtretweakrefR ttimeRHt threadingtthreadR\tdummy_threadingt dummy_threadtclockR5RR RRRR;RRMR!R1RrtVERBOSERWReRlR¡(((s-/usr/lib/python2.6/site-packages/mako/util.pytsF "H         :  -