/usr/lib/python2.6/site-packages/funcsigs
NameSizeModeActions
version.py220644editdlrm
version.pyc1690644editdlrm
__init__.py303900644editdlrm
__init__.pyc223050644editdlrm
Edit: /usr/lib/python2.6/site-packages/funcsigs/__init__.pyc (22305B)
Ñò : Wc@`sÞdZddklZlZlZddkZddkZddkZddkZyddk l Z Wn#e j oddk l Z nXddk lZdddd gZeeiƒZeeiƒZeeeifZdd „Zd „Zd „Zd efd„ƒYZdefd„ƒYZdefd„ƒYZedddƒZ edddƒZ!edddƒZ"edddƒZ#edddƒZ$defd„ƒYZ%defd„ƒYZ&defd„ƒYZ'dS( s¯Function signature objects for callables Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.6, 2.7 and 3.3+. i(tabsolute_importtdivisiontprint_functionN(t OrderedDict(t __version__tBoundArgumentst Parametert Signaturet signaturecC`sNt|tƒo4|idd|fjo|iS|id|iSt|ƒS(Ntbuiltinst __builtin__t.(t isinstancettypet __module__t__name__trepr(t annotationt base_module((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pytformatannotations cG`sxyH|tjodSt||ƒ}x |D]}t|||ƒ}q+WWntj odSXt|tƒp|SdS(N(R tgetattrtAttributeErrorR t_NonUserDefinedCallables(tclst method_nametnestedtmethtname((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyt_get_user_defined_method's cC`s/t|ƒptdi|ƒƒ‚nt|tiƒoÊt|iƒ}|idjo|St |i i ƒƒ}| p|di ttfjotdƒ‚n|di }|ttfjo|d}n|tj otdƒ‚n|id|ƒSny |i}Wntj onX|dj o|Sy |i}Wntj on Xt|ƒSt|tiƒoti|ƒSt|tiƒo-t|iƒ}t|i iƒƒ}|i pd}|i!ph}y|i"||Ž}Wn0tj o$} di|ƒ} t| ƒ‚nXx†|i#iƒD]u\} } || } | |jo | id| d t$ƒ|| tkwargsRE((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR!Çs cC`s|iS(N(RZ(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyt__str__ÌscC`sdi|iƒS(Ns<_ParameterKind: {0!r}>(R&RZ(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyt__repr__Ïs(RRR!R]R^(((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRXÆs  RtPOSITIONAL_ONLYitPOSITIONAL_OR_KEYWORDitVAR_POSITIONALit KEYWORD_ONLYit VAR_KEYWORDcB`sËeZdZdZeZeZeZ e Z e Z eZeeed„Zed„ƒZed„ƒZed „ƒZed „ƒZeeeeed „Zd „Zd „Zd„Zd„Zd„ZRS(sÖRepresents a parameter in a function signature. Has the following public attributes: * name : str The name of the parameter as a string. * default : object The default value for the parameter if specified. If the parameter has no default value, this attribute is not set. * annotation The annotation for the parameter if specified. If the parameter has no annotation, this attribute is not set. * kind : str Describes how argument values are bound to the parameter. Possible values: `Parameter.POSITIONAL_ONLY`, `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`, `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`. RZt_kindt_defaultt _annotationRcC`s)|tttttfjotdƒ‚n||_|tj o6|ttfjodi|ƒ}t|ƒ‚qxn||_ ||_ |djo*|tjotdƒ‚n||_ n\t |ƒ}|tjo9tid|tiƒ odi|ƒ}t|ƒ‚n||_ ||_dS(Ns,invalid value for 'Parameter.kind' attributes){0} parameters cannot have default valuess<None is not a valid name for a non-positional-only parameters [a-z_]\w*$s#{0!r} is not a valid parameter name(R3R2R4R0R/R1RdRWR&ReRfR+RZtstrtretmatchtIR(R[RR.RRRRN((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR"øs(         ' cC`s|iS(N(RZ(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRscC`s|iS(N(Re(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRscC`s|iS(N(Rf(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRscC`s|iS(N(Rd(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR.!sc C`s§|tjo |i}n|tjo |i}n|tjo |i}n|tjo |i}n|tjo |i}nt|ƒ||d|d|d|ƒS(s+Creates a customized copy of the Parameter.RRR(RURZRdRfReRR (R[RR.RRR((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR5%s          cC`sá|i}|i}|tjo*|djo d}ndi|ƒ}n|itj odi|t|iƒƒ}n|itj odi|t |iƒƒ}n|t jod|}n|t jod|}n|S(Nts<{0}>s{0}:{1}s{0}={1}t*s**( R.RZR3R+R&RfRWRReRR4R/(R[R.t formatted((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR];s         cC`s"di|iit|ƒ|iƒS(Ns<{0} at {1:#x} {2!r}>(R&t __class__RtidR(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR^SscC`s%di|iiƒ}t|ƒ‚dS(Nsunhashable type: '{0}'(R&RnRR%(R[RN((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyt__hash__WscC`s\t|itƒoI|i|ijo6|i|ijo#|i|ijo|i|ijS(N(t issubclassRnRRZRdReRf(R[tother((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyt__eq__[s cC`s|i|ƒ S(N(Rs(R[Rr((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyt__ne__bs(s_names_kinds_defaults _annotations_partial_kwarg(RRRVt __slots__R3R_R2R`R4RaR0RbR/RcRWtemptytFalseR"tpropertyRRRR.RUR5R]R^RpRsRt(((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRÚs*      cB`s_eZdZd„Zed„ƒZed„ƒZed„ƒZd„Zd„Z d„Z RS(sResult of `Signature.bind` call. Holds the mapping of arguments to the function's parameters. Has the following public attributes: * arguments : OrderedDict An ordered mutable mapping of parameters' names to arguments' values. Does not contain arguments' default values. * signature : Signature The Signature object that created this instance. * args : tuple Tuple of positional arguments values. * kwargs : dict Dict of keyword arguments values. cC`s||_||_dS(N(RAt _signature(R[RRA((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR"ws cC`s|iS(N(Ry(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR{scC`s®g}x›|iiiƒD]‡\}}|ittfjp |ioPny|i|}Wntj oPqX|it jo|i |ƒq|i |ƒqWt |ƒS(N( RyRR=R.R/R0RRAtKeyErrorR4textendtappendR,(R[R>t param_nameRQtarg((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR>s  cC`såh}t}xÒ|iiiƒD]¾\}}|pK|ittfjp |io t}q}||i jo t}qq}n|pqny|i |}Wnt j oqX|itjo|i |ƒq|||R\RpRsRt(((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRfs   cB`s¶eZdZdZeZeZeZ dee d„Z e d„ƒZed„ƒZed„ƒZeed„Zd„Zd „Zd „Zed „Zd „Zd „Zd„ZRS(sA Signature object represents the overall signature of a function. It stores a Parameter object for each parameter accepted by the function, as well as information specific to the function itself. A Signature object has the following public attributes and methods: * parameters : OrderedDict An ordered mapping of parameters' names to the corresponding Parameter objects (keyword-only arguments are in the same order as listed in `code.co_varnames`). * return_annotation : object The annotation for the return type of the function if specified. If the function has no annotation for its return type, this attribute is not set. * bind(*args, **kwargs) -> BoundArguments Creates a mapping from positional and keyword arguments to parameters. * bind_partial(*args, **kwargs) -> BoundArguments Creates a partial mapping from positional and keyword arguments to parameters (simulating 'functools.partial' behavior.) t_return_annotationt _parametersc C`s2|djo tƒ}n|oåtƒ}t}xét|ƒD]Á\}}|i}||jo+d} | i||iƒ} t| ƒ‚n|}|i} | djo"t|ƒ} |i d| ƒ}n| |jodi| ƒ} t| ƒ‚n||| s N( R+RR3t enumerateR.R&R1RRgR5R‚R( R[Rtreturn_annotationt__validate_parameters__RGttop_kindtidxRQR.RNR((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR"ås2             cC`sÖt|tiƒptdi|ƒƒ‚n|i}|i}|i}|i}t || ƒ}t |ddƒ}||||!}t |dhƒ} |i } t |ddƒ} | ot | ƒ} nd} g} || }xC|| D]7}| i|tƒ}| i||d|dtƒƒqèWxYt||ƒD]G\}}| i|tƒ}| i||d|dtd| |ƒƒq4W|id @oC|||}| i|tƒ}| i||d|dtƒƒnxn|D]f}t}| dj o| i|tƒ}n| i|tƒ}| i||d|dtd|ƒƒq×W|id @oe||}|id @o|d 7}n||}| i|tƒ}| i||d|dtƒƒn|| d | id tƒdtƒS(s2Constructs Signature for the given python functions{0!r} is not a Python functiontco_kwonlyargcountit__annotations__t__kwdefaults__RR.RiiiR…treturnR†N(R R'R8R%R&t_parameter_clst__code__t co_argcountt co_varnamesR,Rt __defaults__R+tlentgetRWR|R2R„tco_flagsR4R0R/Rw(RR<Rt func_codet pos_countt arg_namest positionaltkeyword_only_countt keyword_onlyt annotationstdefaultst kwdefaultstpos_default_countRtnon_default_countRRtoffsetRtindex((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR9 sj            cC`s>yti|iƒSWn#tj ot|iiƒƒSXdS(N(R'tMappingProxyTypeR‚RRR=(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRTscC`s|iS(N(R(R[((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR…[scC`sP|tjo|iiƒ}n|tjo |i}nt|ƒ|d|ƒS(sCreates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy. R…(RURR-RR (R[RR…((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR5_s    cC`s%di|iiƒ}t|ƒ‚dS(Nsunhashable type: '{0}'(R&RnRR%(R[RN((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRpnscC`s<tt|ƒtƒ p2|i|ijpt|iƒt|iƒjotStd„t|ii ƒƒDƒƒ}xÂt|ii ƒƒD]«\}\}}|i t jo>y|i|}Wnt j otSX||jotSq‰y||}Wnt j otSX||jp||i|jotSq‰WtS(Ncs`s%x|]\}}||fVqWdS(N((RƒRˆRQ((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pys xs (RqR RR…R’RRwtdictR„tkeysR=R.R0RzRB(R[Rrtother_positionsRˆR}RQt other_paramt other_idx((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRsrs.     cC`s|i|ƒ S(N(Rs(R[Rr((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRtsc C`sÁtƒ}t|iiƒƒ}d}t|ƒ}|oLxI|iiƒD]4\}} | io||jo| i||R\R;RARt parameters_extarg_valsR}RQtarg_valRNR-t kwargs_param((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyt_bind“s–             cO`s|di|d|ƒS(s¹Get a BoundArguments object, that maps the passed `args` and `kwargs` to the function's signature. Raises `TypeError` if the passed arguments can not be bound. ii(R²(R>R\((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pytbindscO`s|i||dtƒS(sÂGet a BoundArguments object, that partially maps the passed `args` and `kwargs` to the function's signature. Raises `TypeError` if the passed arguments can not be bound. R;(R²RB(R[R>R\((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR@sc C`sèg}t}x‡t|iiƒƒD]p\}}t|ƒ}|i}|tjo t}n,|tjo|o|i dƒt}n|i |ƒq"Wdi di |ƒƒ}|i t j o&t|i ƒ}|di |ƒ7}n|S(NRls({0})s, s -> {0}(RBR„RR-RgR.R4RwR0R|R&tjoinR…RWR( R[tresulttrender_kw_only_separatorRˆRQRmR.trenderedtanno((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyR]!s"       (s_return_annotations _parametersN(RRRVRuRRRR­RWRvR+RBR"t classmethodR9RxRR…RUR5RpRsRtRwR²R³R@R](((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyRÇs$ %I    €  ((RVt __future__RRRR«R:RhR't collectionsRt ImportErrort ordereddicttfuncsigs.versionRt__all__R R t_WrapperDescriptortallt_MethodWrapperRDRR+RRRtobjectRURWRYRXR3R2R4R0R/RRR(((s3/tmp/pip-build-wCUybK/funcsigs/funcsigs/__init__.pyts<        ‡ Œa