Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / oslo_utils / reflection.pyc
Size: Mime:
ó
MEYc@s'dZddlZddlZddlZy
ejZWnek
rPeZnXdZej	r~ej
Z
ejZejZ
n'ddlZej
Z
ejZejZ
ed„Zed„Zeed	„Zeeed
„Zd„Zd„Zed
„Zd„Zd„Zed„Zd„ZdS(s+
Reflection module.

.. versionadded:: 1.1
iÿÿÿÿNtbuiltinst__builtin__t__builtins__t
exceptionsccsJxCtj|ƒD]2\}}|jdƒr7|r7qn||fVqWdS(s`Yields the members of an object, filtering by hidden/not hidden.

    .. versionadded:: 2.3
    t_N(tinspectt
getmemberst
startswith(tobjtexclude_hiddentnametvalue((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytget_members2scCs)gt|d|ƒD]\}}|^qS(s&Get all the member names for a object.R	(R(RR	R
t_obj((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytget_member_names=scCsÎtj|ƒrtdƒ‚ntj|ƒr<t|ƒ}nt|tjƒs]t|ƒ}n|ršy|j	t
k}Wntk
r‰qšX|rš|jSn|rÃt
|dƒrÃd|j	|jfS|jSdS(sáGet class name for object.

    If object is a type, returns name of the type. If object is a bound
    method or a class method, returns its ``self`` object's class name.
    If object is an instance of class, returns instance's class name.
    Else, name of the type of the object is returned. If fully_qualified
    is True, returns fully qualified name of the type. For builtin types,
    just name is returned. TypeError is raised if can't get class name from
    object.
    sCan't get class name.t
__module__s%s.%sN(Rt
isfunctiont	TypeErrortismethodtget_method_selft
isinstancetsixtclass_typesttypeRt_BUILTIN_MODULEStAttributeErrort__name__thasattr(Rtfully_qualifiedttruncate_builtinstbuilt_in((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytget_class_nameCs 

ccset|tjƒs!t|ƒ}nx=|jƒD]/}t||ƒr.t|d|d|ƒVq.q.WdS(sGet class names of object parent classes.

    Iterate over all class names object is instance or subclass of,
    in order of method resolution (mro). If up_to parameter is provided,
    only name of classes that are sublcasses to that class are returned.
    RRN(RRRRtmrot
issubclassR(Rtup_toRRtcls((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytget_all_class_namescs	cCs~t|ƒ}|dk	r„t|tjƒr3|}nt|ƒ}y|j|jf}Wqqtk
r€|j|j	|j	f}qqXnít
j|ƒs¢t
j|ƒry|j|jf}Wqqtk
rt
|dƒrû|j}|j|j	|j	f}q|j|j	f}qqXn]t|ƒ}|tkr5|}ny|j|jf}Wn#tk
rp|j|j	f}nXdj|ƒS(seGenerate a name from callable.

    Tries to do the best to guess fully qualified callable name.
    tim_classt.N(RtNoneRRRRRt__qualname__RRRRRRR%t
_TYPE_TYPEtjoin(tfunctiontmethod_selfR%tparts((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytget_callable_namets4	

		
cCs=tj|ƒsdSytj|ƒSWntk
r8dSXdS(s;Gets the ``self`` object attached to this method (or none).N(RRR'RRR(tmethod((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pyRœs
cCsm||krtS||kri|s&tSy,tj|ƒ}tj|ƒ}||kSWqitk
reqiXntS(s*Returns if the two callbacks are the same.(tTrueRRRtFalse(t	callback1t	callback2tstricttself1tself2((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytis_same_callback¦s
cCst|ƒdk	S(s2Returns if the given method is bound to an object.N(RR'(R/((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytis_bound_method½scCstj|ƒot||ƒS(sCReturns if the object is class and it is subclass of a given class.(RtisclassR!(RR#((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytis_subclassÂscCsŽt|ƒ}ttj|jƒƒ}xctj|jƒD]O\}}|jtjtj	fksv|r7|j
tjk	r7|j|ƒq7q7W|S(sêGet names of callable arguments.

    Special arguments (like ``*args`` and ``**kwargs``) are not included into
    output.

    If required_only is True, optional arguments (with default values)
    are not included into output.
    (
t
get_signaturetlistRtiterkeyst
parameterst	iteritemstkindt	ParametertVAR_POSITIONALtVAR_KEYWORDtdefaulttemptytremove(R+t
required_onlytsigt
function_argst
param_nametp((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytget_callable_argsÇs	cCs,t|ƒ}td„tj|jƒDƒƒS(s@Returns ``True`` if function accepts kwargs otherwise ``False``.css!|]}|jtjkVqdS(N(R@RARC(t.0RK((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pys	<genexpr>Üs(R;tanyRt
itervaluesR>(R+RH((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pytaccepts_kwargsÙs	(sbuiltinss__builtin__s__builtins__s
exceptions(t__doc__RttypesRtTypeTypeR)RRRtPY3RAt	Signaturet	signatureR;tfuncsigsR0RRRtobjectR$R.RR7R8R:R1RLRP(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/reflection.pyt<module>s8


						 	(