%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyc

�
�ǚPc@sddlZddlZeede�p6ejd*kZejd+kZejd,kZejj	d�Z
ejj	d	�Zeed
�Z
er�ddlmZn.yddlmZWnddlmZnXddlZddlZddlZddlZddlZddlZddlZyddlZddlZWn)ek
rlddlZddlZnXesye
r�ejZn	ejZd�Zydd
l m!Z!Wnd�Z!nXes�d�Z"d�Z#ne"Z"d�Z#de$fd��YZ%d�Z&dd�Z(de$fd��YZ)de$fd��YZ*de+fd��YZ,de$fd��YZ-de+fd��YZ.ej/d ej0�Z1d!�Z2d"�Z3d#�Z4y#dd$l5m6Z6m7Z7d%�Z8Wn&ek
r�ddl5Z5d&�Z8nXd'd(�Z9d)�Z:dS(-i����Ntpy3kwarningiiiiitjavatwintpypy_version_info(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:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytfunction_named)s	(tpartialcs���fd�}|S(Ncs*�j�}|j|���||�S(N(tcopytupdate(tfargst	fkeywordstnewkeywords(targstfunctkeywords(s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytnewfunc7s
((RRRR((RRRs:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR	6scCsx|D]}|stSqWtS(N(tFalsetTrue(titerableti((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytall>s
cCs*y|jjSWntk
r%|jSXdS(N(t	__class__RtAttributeError(texc((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytexception_nameDs
cCs
|jjS(N(RR(R((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRLstPluginLoadercBs#eZd�Zd�Zd�ZRS(cCs||_i|_dS(N(tgrouptimpls(tselfR((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyt__init__Qs	cCs�||jkr|j|�Sddl}x`|j|j|�D]}|j|j|<|j�SWddlm}|jd|j|f��dS(Ni����(t
exceptionssCan't load plugin %s %s(Rt
pkg_resourcestiter_entry_pointsRtloadtmakoR!tRuntimeException(RRR"timplR!((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR$Us	
cs#��fd�}||j|<dS(NcsFt��}x*�jd�dD]}t||�}q Wt|��S(Nt.i(t
__import__tsplittgetattr(tmodttoken(t
modulepathtobjname(s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR$fs(R(RRR.R/R$((R.R/s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytregisteres(Rt
__module__R R$R0(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRPs		cCs]d}xPtjj|�sXy|d7}tj|d�Wq	|dkrU�qUq	Xq	WdS(s,create and/or verify a filesystem directory.iii�iN(tostpathtexiststmakedirs(tdirttries((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytverify_directoryms
cCs4|dkr|St|ttf�s,|gS|SdS(N(tNonet
isinstancetlistttuple(txtdefault((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytto_listzs
tmemoized_propertycBs#eZdZdd�Zd�ZRS(s2A read-only @property that is only evaluated once.cCs+||_|p|j|_|j|_dS(N(tfgett__doc__R(RRAtdoc((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR �s	cCs1|dkr|S|j|�|j|j<}|S(N(R9RAt__dict__R(Rtobjtclstresult((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyt__get__�sN(RR1RBR9R RH(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR@�stmemoized_instancemethodcBs#eZdZdd�Zd�ZRS(s�Decorate a method memoize its return value.

    Best applied to no-arg methods: memoization is not sensitive to
    argument values, and will always return the same value even when
    called with different arguments.

    cCs+||_|p|j|_|j|_dS(N(RARBR(RRARC((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR �s	cs>�dkr�S��fd�}�j|_�j|_|S(NcsP�j�||���fd�}�j|_�j|_|�j�j<�S(Ncs�S(N((tatkw(RG(s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyt<lambda>�s(RARRBRD(RRKtmemo(RER(RGs:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytoneshot�s(R9RRB(RRERFRN((RERs:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRH�sN(RR1RBR9R RH(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRI�stSetLikeDictcBseZdZd�ZRS(s0a dictionary that has some setlike methods on itcCst|�}|j|�|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(ROR(RtotherR=((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytunion�s
(RR1RBRQ(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRO�stFastEncodingBuffercBs2eZdZdded�Zd�Zd�ZRS(sma very rudimentary buffer that is faster than StringIO,
    but doesn't crash on unicode data like cStringIO.tstrictcCsXtj�|_||_|r*d|_n	d|_||_||_|jj|_dS(Nut(	tcollectionstdequetdatatencodingtdelimtunicodeterrorstappendtwrite(RRXR[RZ((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR �s				cCs"tj�|_|jj|_dS(N(RURVRWR\R](R((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyttruncate�scCsE|jr.|jj|j�j|j|j�S|jj|j�SdS(N(RXRYtjoinRWtencodeR[(R((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytgetvalue�s	
N(RR1RBR9RR R^Ra(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRR�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(RRdRe((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR �s		cCs
t|j�S(N(treprRe(R((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyt__repr__�s(RR1R Ri(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRc�s	g�?cCs||_||_dS(N(tcapacityt	threshold(RRjRk((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR �s	cCs%tj||�}t�|_|jS(N(tdictt__getitem__RfRgRe(RRdtitem((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRm�scCs#gtj|�D]}|j^qS(N(RltvaluesRe(RR((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRo�scCs&||kr||S|||<|SdS(N((RRdRe((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyt
setdefault�s
cCs]tj||�}|dkrF|j||�}tj|||�n	||_|j�dS(N(RltgetR9Rct__setitem__Ret_manage_size(RRdReRn((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRr�s	cCs�x�t|�|j|j|jkr�ttj|�dtjd�dt�}x8||jD])}y||j	=Wq^t
k
r�Pq^Xq^WqWdS(NRdRgtreverse(tlenRjRktsortedRlRotoperatort
attrgetterRRdtKeyError(RtbytimeRn((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRs�s&
(RR1RBtobjectRcR RmRoRpRrRs(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyRb�s					s([ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)cCs-|j�}|jd�z�|j�}|jtj�}|rV|ttj�}ntj|j	dd��}|s�y)ddl
}|j|j	dd��Wntt
fk
r�q�X|j�}tj|j	dd��}n|r|r�t
d�ndS|r|jd�SdSWd|j|�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_UTF8Rut_PYTHON_MAGIC_COMMENT_retmatchtdecodetparsertsuitetImportErrortSyntaxErrorRR9(tfptpostline1thas_bomtmR�tline2((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytparse_encoding
s4

	
cCsL|j�}|j�ddjg|D]}d|||f^q&�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�tk((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytsorted_dict_repr<s
cCs�t|d�rdSd|_tddd|j�}t|�|_xJ|jjD]<}|jdkrq||_qP|jdkrP||_qPqPWt|j	d	�|_
t|j	d
�|_t|j	d�|_t|j	dj
d	�|_t|j	dj
d	j�|_t|j	dj�|_t|j	djj�|_t|j	djjj�|_t|j	djjj�|_t|j	djjjj�|_t|j	d
jj�|_t|j	d
jjj�|_t|j	d
jjjj�|_t|j	d
jjjjj�|_t|j	djj�|_t|j	djjj�|_t|j	djjjj�|_ t|j	djj�|_!t|j	djj"d	j�|_#t|j	djjj�|_$t|j	djjjj�|_%t|j	djjjj&j�|_'t|j	djjjj�|_(t|j	djj�|_!t|j	djj"d	j�|_#t|j	djj)d	�|_*t|j	djj)d
�|_+t|j	djjj)d	�|_,t|j	djjj)d
�|_-t|j	djj)d	�|_.t|j	djj)d
�|_/t|j	djj)d�|_0t|j	djj)d�|_1t|j	djj)d	�|_2t|j	djj)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	<unknown>texecR,iiiiiiiii
iii(4thasattrt
PyCF_ONLY_ASTtcompilettypetModulet__mro__RR,R�tbodytFunctionDeftClassDeftIfttargetstNametctxtStoreRetStrtoptSubtlefttAddtrighttDivtMulttRShifttLShifttModtFloorDivtBitOrtBitXortBitAndtOrRotAndtInverttNottoperandtUAddtUSubtopstIsNottNotEqtIstEqtGttLttGtEtLtEtIntNotIn(t_astR�RF((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytrestore__astFs\	
 ""%"#"%"#  ##     (tCO_VARKEYWORDSt
CO_VARARGScCs�|j}|j}|j}t|| �}d}|jt@rX|j|}|d}nd}|jt@r{|j|}n||||jfS(Ni(	t	func_codetco_argcounttco_varnamesR;R9tco_flagsR�R�t
func_defaults(RtcotnargstnamesRtvarargstvarkw((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytinspect_func_args�s			



cCs
tj|�S(N(tinspectt
getargspec(R((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyR��strbcCs5t||�}z|j�}|SWd|j�XdS(N(topentreadtclose(R3tmodeR�RW((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyt	read_file�s
cCs8t|d�}ztj|||�SWd|j�XdS(NR�(R�timptload_sourceR�(t	module_idR3R�((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pytload_module�s(ii(ii(ii(;R�tsysR+Rtversion_infotpy3ktpy26tpy25tplatformR�tjythontwin32R�tpypytioRt	cStringIOR�tretweakrefR2ttimeRwRUt	threadingtthreadR�tdummy_threadingtdummy_threadtclockRfRt	functoolsR	RRR{RR8R9R?R@RIRlRORRRbR�tVERBOSER�R�R�R�R�R�R�R�R�R�(((s:/opt/alt/python27/lib/python2.7/site-packages/mako/util.pyt<module>sp!H
		

			
	

:	/	
	L




Zerion Mini Shell 1.0