MINI MINI MANI MO

Path : /lib/python2.7/site-packages/
File Upload :
Current File : //lib/python2.7/site-packages/decorator.pyc

ó
‰ÂPc@sVdZdZdddgZddlZddlZddlZejdkrjddlmZd	„Znd
e	fd„ƒYZd„Zej
d
ƒZde	fd„ƒYZdd„Zd„Zy2ddlmZedefedeƒƒZWnNek
rEddlmZd„ZedefededeƒƒZnXeeƒZdS(sT
Decorator module, see http://pypi.python.org/pypi/decorator
for the documentation.
s3.4.0t	decoratort
FunctionMakertcontextmanageriÿÿÿÿNt3(tgetfullargspeccCs|jS(N(t__init__(tcls((s-/usr/lib/python2.7/site-packages/decorator.pytget_init*sRcBs eZdZd„Zd„ZRS(s?A quick and dirty replacement for getfullargspec for Python 2.XcCs=tj|ƒ\|_|_|_|_g|_d|_dS(N(	tinspectt
getargspectargstvarargstvarkwtdefaultst
kwonlyargstNonetkwonlydefaults(tselftf((s-/usr/lib/python2.7/site-packages/decorator.pyR/s'	ccs$|jV|jV|jV|jVdS(N(R
RRR
(R((s-/usr/lib/python2.7/site-packages/decorator.pyt__iter__4s(t__name__t
__module__t__doc__RR(((s-/usr/lib/python2.7/site-packages/decorator.pyR-s	cCs
|jjS(N(Rtim_func(R((s-/usr/lib/python2.7/site-packages/decorator.pyR9ss\s*def\s*([_\w][_\w\d]*)\s*\(cBs_eZdZdddddddd„Zd„Zded„Zeddde	d„ƒZ
RS(s´
    An object with the ability to create functions with a given signature.
    It has attributes name, doc, module, signature, defaults, dict and
    methods update and make.
    cCsÛ||_|r.|j|_|jdkr6d|_n|j|_|j|_tj|ƒr.t	|ƒ}t
|diƒ|_x'dD]}	t||	t
||	ƒƒq…Wx1t
|jƒD] \}
}t|d
|
|ƒq¸Wtjdkrtjdd
„|Œdd!|_|_nÿt|jƒ}t|jƒ}
|jri|jd|jƒ|
jd|jƒn|jr‚|jdƒnx9|jD].}	|jd|	ƒ|
jd|	|	fƒqŒW|jrò|jd|jƒ|
jd|jƒndj|ƒ|_dj|
ƒ|_|jjƒ|_q.n|r@||_n|dk	rX||_n|rj||_n|r|||_n|rŽ||_n|r ||_nt|dƒsµt‚t|dƒs×t d|ƒ‚ndS(Ns<lambda>t_lambda_t__annotations__R
RRR
RRsarg%dRtformatvaluecSsdS(Nt((tval((s-/usr/lib/python2.7/site-packages/decorator.pyt<lambda>Zsiiÿÿÿÿt*s%s=Nones%s=%ss**s, tnamet	signatures%You are decorating a non function: %s(sargssvarargssvarkwsdefaultss
kwonlyargsskwonlydefaults(!tshortsignatureRRRtdocRtmoduleRt
isfunctionRtgetattrtannotationstsetattrt	enumerateR
tsystversiont
formatargspecR tlistRtappendRRtjoint__dict__tcopytdictRR
thasattrtAssertionErrort	TypeError(RtfuncRR R
R"R#tfuncdicttargspectatitargtallargstallshortargs((s-/usr/lib/python2.7/site-packages/decorator.pyREsb	
	#			cKs¼|j|_t|dd
ƒ|_t|diƒ|_t|ddƒ|_t|dd
ƒ|_t|dd
ƒ|_t	j
dƒjjddƒ}t|d	|ƒ|_
|jj|ƒd
S(s2Update the signature of func with the data in selfR"R1R
RR&iRt?R#N((RRR%RRR/t
func_defaultst__kwdefaults__RR)t	_getframet	f_globalstgetRtupdate(RR5tkwtcallermodule((s-/usr/lib/python2.7/site-packages/decorator.pyRC~sc
Js\|e|ƒ}|pi}ej|ƒ}|d
krJed|ƒ‚n|jdƒ}e|gg|jjdƒD]}|j	dƒ^quƒ}	x3|	D]+}
|
dkr›e
d|
|fƒ‚q›q›W|jdƒsæ|d7}nye|d	d
ƒ}||UWn$e
jdIJe
j|IJ‚nX||}|rH||d<n|j|||S(sBMake a new function from a given template and update the signatures not a valid function template
%sit,s *t_func_t_call_s%s is overridden in
%ss
s<string>tsinglesError in generated code:t
__source__N(s_func_RH(tvarstDEFtmatchRtSyntaxErrortgrouptsetR!tsplittstript	NameErrortendswithtcompileR)tstderrRC(
Rt	src_templtevaldictt	addsourcetattrstsrctmoRR:tnamestntcodeR5((s-/usr/lib/python2.7/site-packages/decorator.pytmakeŠs2/





cKs¦t|tƒr@|jƒjddƒ\}	}
|
d }d}nd}	d}|}|||	||||ƒ}
djd„|jƒDƒƒ}|
jd||||S(sú
        Create a function from the strings name, signature and body.
        evaldict is the evaluation dictionary. If addsource is true an attribute
        __source__ is added to the result. The attributes attrs are added,
        if any.
        t(iiÿÿÿÿs
css|]}d|VqdS(s    N((t.0tline((s-/usr/lib/python2.7/site-packages/decorator.pys	<genexpr>¹ssdef %(name)s(%(signature)s):
N(t
isinstancetstrRRRQRR.t
splitlinesR`(RtobjtbodyRXR
R"R#RYRZRtrestR R5Rtibody((s-/usr/lib/python2.7/site-packages/decorator.pytcreate§s	
	
N(RRRRRRCtFalseR`tclassmethodtTrueRk(((s-/usr/lib/python2.7/site-packages/decorator.pyR?s	8	cCs–|dk	rN|jjƒ}||d<||d<tj|d|d|d|ƒStj|ƒr¤|jjƒ}t	|ƒ}d|j|jf}t
|ƒjd}ntj|ƒrö|jdkrÈd	n|j}|}|j
}t
|ƒjd
}n=|jjjƒ}|jj}|jj
}t
|ƒjd}|jjƒ}||d<t|d<tjd||fd
||d|d|d|d|jƒSdS(s‰
    decorator(caller) converts a caller function into a decorator;
    decorator(caller, func) decorates a function using a caller.
    RHRGs)return _call_(_func_, %(shortsignature)s)tundecoratedt__wrapped__sHdecorator(%s) converts functions/generators into factories of %s objectsis<lambda>RiRs%s(%s)sreturn decorator(_call_, %s)R"R#N(Rtfunc_globalsR0RRkRtisclassRtlowerRRR
R$Rt	__class__t__call__RRR(tcallerR5RXRt
callerfuncR"tfun((s-/usr/lib/python2.7/site-packages/decorator.pyR½s>

		


cCs(tj|dtd|d|ƒd|ƒS(sContext manager decorators.with _self_: return _func_(%(shortsignature)s)t_self_RGRp(RRkR1(RR5((s-/usr/lib/python2.7/site-packages/decorator.pyRuæs(t_GeneratorContextManagertContextManagerRu(tGeneratorContextManagercOstj||||ŽƒS(N(R|R(RRR8tk((s-/usr/lib/python2.7/site-packages/decorator.pyRõsR(Rt__version__t__all__R)treRR*RRtobjectRURLRRRRut
contextlibRzttypeR1R{tImportErrorR|RR(((s-/usr/lib/python2.7/site-packages/decorator.pyt<module>!s.$	~)	
		

OHA YOOOO