Ñò žòœMc@s¸ddkZeedeƒp eid!jZeid"jo eid#jZeiidƒZeiid ƒZ eodd k l Z n/ydd k l Z Wndd k l Z nXddk Z ddkZddkZddkZddkZddkZddkZyddkZddkZWn+ej oddkZddkZnXe peo eiZn eiZd „Zydd klZWnd „ZnXeo d„Zn d„Zd„Zdd„Z!de"fd„ƒYZ#de$fd„ƒYZ%de"fd„ƒYZ&de$fd„ƒYZ'ei(dei)ƒZ*d„Z+d„Z,d„Z-y#ddk.l/Z/l0Z0d„Z1Wn(ej oddk.Z.d „Z1nXdS($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/vendor-packages/mako/util.pytfunction_named&s (tpartialcs‡‡‡fd†}|S(Ncs*ˆiƒ}|i|ƒˆˆ||ŽS(N(tcopytupdate(tfargst fkeywordst newkeywords(targstfunctkeywords(s//usr/lib/python2.6/vendor-packages/mako/util.pytnewfunc4s  ((RRRR((RRRs//usr/lib/python2.6/vendor-packages/mako/util.pyR3scCs,y|iiSWntj o |iSXdS(N(t __class__RtAttributeError(texc((s//usr/lib/python2.6/vendor-packages/mako/util.pytexception_name;scCs |iiS(N(RR(R((s//usr/lib/python2.6/vendor-packages/mako/util.pyRAscCsad}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/vendor-packages/mako/util.pytverify_directoryDs  cCs8|djo|St|ttfƒp|gS|SdS(N(tNonet isinstancetlistttuple(txtdefault((s//usr/lib/python2.6/vendor-packages/mako/util.pytto_listQs  tmemoized_propertycBs#eZdZdd„Zd„ZRS(s2A read-only @property that is only evaluated once.cCs,||_|p|i|_|i|_dS(N(tfgett__doc__R(tselfR%tdoc((s//usr/lib/python2.6/vendor-packages/mako/util.pyt__init__\s cCs3|djo|S|i|ƒ|i|i<}|S(N(RR%t__dict__R(R'tobjtclstresult((s//usr/lib/python2.6/vendor-packages/mako/util.pyt__get__as N(Rt __module__R&RR)R.(((s//usr/lib/python2.6/vendor-packages/mako/util.pyR$Zs t SetLikeDictcBseZdZd„ZRS(s0a dictionary that has some setlike methods on itcCst|}|i|ƒ|S(s‰produce a 'union' of this dict and another (at the key level). values in the second dict take precedence over that of the first(R0R (R'totherR!((s//usr/lib/python2.6/vendor-packages/mako/util.pytunionis  (RR/R&R2(((s//usr/lib/python2.6/vendor-packages/mako/util.pyR0gstFastEncodingBuffercBs2eZdZdded„Zd„Zd„ZRS(sna very rudimentary buffer that is faster than StringIO, but doesn't crash on unicode data like cStringIO.tstrictcCsZtiƒ|_||_|o d|_n d|_||_||_|ii|_dS(Nut( t collectionstdequetdatatencodingtdelimtunicodeterrorstappendtwrite(R'R9R<R;((s//usr/lib/python2.6/vendor-packages/mako/util.pyR)us     cCs"tiƒ|_|ii|_dS(N(R6R7R8R=R>(R'((s//usr/lib/python2.6/vendor-packages/mako/util.pyttruncate€scCsG|io&|ii|iƒi|i|iƒS|ii|iƒSdS(N(R9R:tjoinR8tencodeR<(R'((s//usr/lib/python2.6/vendor-packages/mako/util.pytgetvalue„s &N(RR/R&RtFalseR)R?RB(((s//usr/lib/python2.6/vendor-packages/mako/util.pyR3qs 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(R'RFRG((s//usr/lib/python2.6/vendor-packages/mako/util.pyR)”s  cCs t|iƒS(N(treprRG(R'((s//usr/lib/python2.6/vendor-packages/mako/util.pyt__repr__˜s(RR/R)RK(((s//usr/lib/python2.6/vendor-packages/mako/util.pyRE“s gà?cCs||_||_dS(N(tcapacityt threshold(R'RLRM((s//usr/lib/python2.6/vendor-packages/mako/util.pyR)›s cCs%ti||ƒ}tƒ|_|iS(N(tdictt __getitem__RHRIRG(R'RFtitem((s//usr/lib/python2.6/vendor-packages/mako/util.pyROŸs cCs+g}ti|ƒD]}||iq~S(N(RNtvaluesRG(R't_[1]ti((s//usr/lib/python2.6/vendor-packages/mako/util.pyRQ¤scCs(||jo ||S|||<|SdS(N((R'RFRG((s//usr/lib/python2.6/vendor-packages/mako/util.pyt setdefault§s   cCs_ti||ƒ}|djo)|i||ƒ}ti|||ƒn ||_|iƒdS(N(RNtgetRREt __setitem__RGt _manage_size(R'RFRGRP((s//usr/lib/python2.6/vendor-packages/mako/util.pyRV®s   cCs—xt|ƒ|i|i|ijoktti|ƒdtidƒdtƒ}x:||iD]+}y||i =Wq_t j oPq_Xq_WqWdS(NRFRItreverse( tlenRLRMtsortedRNRQtoperatort attrgettertTrueRFtKeyError(R'tbytimeRP((s//usr/lib/python2.6/vendor-packages/mako/util.pyRW·s$( RR/R&tobjectRER)RORQRTRVRW(((s//usr/lib/python2.6/vendor-packages/mako/util.pyRDŠs     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_UTF8RYt_PYTHON_MAGIC_COMMENT_retmatchtdecodetparsertsuitet ImportErrort SyntaxErrortgroupR(tfptpostline1thas_bomtmRmtline2((s//usr/lib/python2.6/vendor-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@(tdR{RRtk((s//usr/lib/python2.6/vendor-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__RR‚R€tbodyt FunctionDeftClassDeftIfttargetstNametctxtStoreRGtStrtoptSubtlefttAddtrighttDivtMulttRShifttLShifttModtFloorDivtBitOrtBitXortBitAndtOrRQtAndtInverttNottoperandtUAddtUSubtopstIsNottNotEqtIstEqtGttLttGtEtLtEtIntNotIn(t_astRvR,((s//usr/lib/python2.6/vendor-packages/mako/util.pyt restore__astÿs^     ""%"#"%"#  ##     (tCO_VARKEYWORDSt CO_VARARGScCs’|i}|i}|i}t|| ƒ}d}|it@o|i|}|d}nd}|it@o|i|}n||||ifS(Ni( t func_codet co_argcountt co_varnamesRRtco_flagsRµR´t func_defaults(RtcotnargstnamesRtvarargstvarkw((s//usr/lib/python2.6/vendor-packages/mako/util.pytinspect_func_argsMs    cCs ti|ƒS(N(tinspectt getargspec(R((s//usr/lib/python2.6/vendor-packages/mako/util.pyRÀ_s(ii(ii(ii(2tsystgetattrRCt version_infotpy3ktpy24tplatformRgtjythontwin32tioRt cStringIORhtretweakrefRttimeR[R6t threadingtthreadRotdummy_threadingt dummy_threadtclockRHRt functoolsRRRRR#R`R$RNR0R3RDR…tVERBOSERjRxRR³RÁR´RµRÀ(((s//usr/lib/python2.6/vendor-packages/mako/util.pyts^ "H            :  - L