MINI MINI MANI MO

Path : /usr/lib64/python2.7/site-packages/gi/
File Upload :
Current File : //usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyc

ó
§Zc@seddlZddlZddlZejjZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'ddfkr6e(Z)e*Z+ne,Z)e-Z+de.fd„ƒYZ/d„Z0dS(	iÿÿÿÿNi(t	TYPE_NONEtTYPE_INTERFACEt	TYPE_CHARt
TYPE_UCHARtTYPE_BOOLEANtTYPE_INTt	TYPE_UINTt	TYPE_LONGt
TYPE_ULONGt
TYPE_INT64tTYPE_UINT64t	TYPE_ENUMt
TYPE_FLAGSt
TYPE_FLOATtTYPE_DOUBLEtTYPE_STRINGtTYPE_POINTERt
TYPE_BOXEDt
TYPE_PARAMtTYPE_OBJECTt
TYPE_PYOBJECTt
TYPE_GTYPEt	TYPE_STRVtTYPE_VARIANTiitPropertyc
BsÎeZdZiee6ee6ee6e	e
6ee6e
e6Zide6de6de6ee6ee	6ee6ee6de6Ziee6ee6de6d e6ee6ee	6ee6ee6Zi	de6de6de6de6de6de6de6de6de	6Zde fd	„ƒYZ!d!d!d!d!dde#j$d!d!d
„	Z%d„Z&d„Z'd
„Z(d„Z)d„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0d„Z1d„Z2d„Z3d„Z4d„Z5RS("sÄCreates a new Property which when used in conjunction with
    GObject subclass will create a Python property accessor for the
    GObject ParamSpec.

    :param callable getter:
        getter to get the value of the property
    :param callable setter:
        setter to set the value of the property
    :param type type:
        type of property
    :param default:
        default value, must match the property type.
    :param str nick:
        short description
    :param str blurb:
        long description
    :param GObject.ParamFlags flags:
        parameter flags
    :keyword minimum:
        minimum allowed value (int, float, long only)
    :keyword maximum:
        maximum allowed value (int, float, long only)

    .. code-block:: python

         class MyObject(GObject.Object):
             prop = GObject.Property(type=str)

         obj = MyObject()
         obj.prop = 'value'

         obj.prop  # now is 'value'

    The API is similar to the builtin :py:func:`property`:

    .. code-block:: python

        class AnotherObject(GObject.Object):
            value = 0

            @GObject.Property
            def prop(self):
                'Read only property.'
                return 1

            @GObject.Property(type=int)
            def propInt(self):
                'Read-write integer property.'
                return self.value

            @propInt.setter
            def propInt(self, value):
                self.value = value
    iii?ii@tgt
__metaclass__cBseZd„ZRS(cCsdS(Ns<class 'GObject.Property'>((tself((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyt__repr__˜s(t__name__t
__module__R(((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR—sc

CsÔd|_|dkrt}n|j|ƒ|_|j|ƒ|_|jƒt|t	ƒsjt
dƒ‚n||_t|t	ƒs‘t
dƒ‚n||_||_
||_|rÅ|rÅ|j}n<|rÞ|rÞ|j}n#|r|r|j}|j}n|j|ƒ||_|dk	rZ||jƒkrft
d|j|jƒfƒ‚qfn|jƒ}||_|	dk	r²|	|jƒkr¾t
d|j|jƒfƒ‚q¾n|jƒ}	|	|_d|_dS(Nsnick must be a stringsblurb must be a strings+Minimum for type %s cannot be lower than %ds,Maximum for type %s cannot be higher than %d(tNonetnametobjectt_type_from_pythonttypet_get_defaulttdefaultt_check_defaultt
isinstancet_basestringt	TypeErrortnicktblurbt__doc__tflagst_readonly_settert_writeonly_gettert_default_gettert_default_settertgettertfsett_get_minimumtminimumt_get_maximumtmaximumt_exc(
RR2tsetterR#R%R*R+R-R5R7((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyt__init__›sL		
				

	
			cCs#d|jpdtj|jƒfS(Ns<GObject Property %s (%s)>s(uninitialized)(R t_gobjectt	type_nameR#(R((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyRÓscCsx|dkr|Sd|_y|j|ƒ}Wn!tk
rOtjƒd}nX|jrt|j}d|_|‚n|S(N(RR8tfgett	Exceptiont	tracebackt	print_exc(Rtinstancetklasstvaluetexc((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyt__get__Øs	


				cCsY|dkrt‚nd|_|j|j|ƒ|jrU|j}d|_|‚ndS(N(RR)R8tset_propertyR (RRARCRD((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyt__set__ñs					cCs
|j|ƒS(s;Allows application of the getter along with init arguments.(R2(RR=((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyt__call__üscCs1|jr$|j|_|j|_n||_|S(s8Set the getter function to fget. For use as a decorator.(R,R+R=(RR=((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR2s
		cCs(||_|js$|jj|_n|S(s8Set the setter function to fset. For use as a decorator.(R3R R=R(RR3((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR9	s		cCsÆ||jkr|j|St|tƒr]t|tjtjtjtjtj	fƒr]|j
S|ttt
ttttttttttttttttttt fkr¯|St!d|fƒ‚dS(NsUnsupported type: %r("t_type_from_pytype_lookupR'R#t
issubclassR;tGObjecttGEnumtGFlagstGBoxedt
GInterfacet	__gtype__RRRRRRRRRR	R
R
RRRRRRRRRRR)(Rttype_((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR"s"		cCs&|dk	r|S|jj|jdƒS(N(Rt_default_lookuptgetR#(RR%((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR$'scCs!|j}|j}|tkrF|ttfkrFtd|fƒ‚n×|tkrp|dk	rtdƒ‚qn­|tkrš|dk	rtdƒ‚qnƒt	j
|tƒrõ|dkrÇtdƒ‚qt	j
||ƒstd||fƒ‚qn(t	j
|tƒr5t	j
||ƒstd||fƒ‚qnèt	j
|t
ƒrÀ|dk	rÀt|tƒs{tdt|ƒƒ‚nxŸ|D]7}t|ƒttfkr‚tdt|ƒƒ‚q‚q‚Wn]t	j
|tƒr|dk	rt|d	ƒst	j
|tƒrtd
||fƒ‚qndS(Ns%default must be True or False, not %rs)object types does not have default valuess(GType types does not have default valuess%enum properties needs a default values'enum value %s must be an instance of %rs(flags value %s must be an instance of %rsStrv value %s must be a lists'Strv value %s must contain only stringsRPs*variant value %s must be an instance of %r(R#R%RtTruetFalseR)RRRR;t	type_is_aRRRR'tlisttreprtstrtbytesRthasattr(RtptypeR%tval((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR&,s>		
 #cCs|jj|jdƒS(N(t_min_value_lookupRSR#R(R((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR4MscCs|jj|jdƒS(N(t_max_value_lookupRSR#R(R((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR6PscCst|d|j|ƒdS(Nt_property_helper_(tsetattrR (RRARC((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR1WscCst|d|j|jƒS(NR`(tgetattrR R%(RRA((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR0ZscCs)td|jt|ƒjfƒ|_dS(Ns%s property of %s is read-only(R)R R#RR8(RRARC((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR.]scCs)td|jt|ƒjfƒ|_dS(Ns%s property of %s is write-only(R)R R#RR8(RRA((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR/asc	Cs|j}|ttttttttfkrH|j	|j
|jf}n¢|tks|t
ks|jtƒs|jtƒs|jtƒrœ|jf}nN|ttfkr·d}n3|jtƒsÕ|jtƒrÞd}nt|ƒ‚|j|j|jf||jfS(N(((R#RRRRR	R
R
RR5R7R%RRtis_aRRRRRRRtNotImplementedErrorR*R+R-(RR\targs((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pytget_pspec_argsis			llûÿÿÿllÿÿÿÿllÿÿÿÿN(6RRR,Rt_longRtintRtboolRtfloatRRYRR!RIRRR
t
G_MAXFLOATR
tG_MAXDOUBLEtG_MININTt	G_MINLONGR	R^t	G_MAXUINTt
G_MAXULONGtG_MAXINTt	G_MAXLONGR_RRR#RRR;tPARAM_READWRITER:RRERGRHR2R9R"R$R&R4R6R1R0R.R/Rf(((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyR3sp6



6							
			!						csvˆjjdiƒ}g}x¨ˆjjƒD]—\}}t|tƒr+|js[||_n|j|krŸ||j|jƒkr‰q+ntd|jƒ‚n|jƒ||j<|j|ƒq+q+W|sÐdS|ˆ_	dˆjks÷dˆjkrHxN|D]C}|j
|jks(|j|j
krþtdˆjfƒ‚qþqþWnd„}|ˆ_‡fd†}|ˆ_dS(	s“
    Scans the given class for instances of Property and merges them
    into the classes __gproperties__ dict if it exists or adds it if not.
    t__gproperties__s0Property %s was already found in __gproperties__Ntdo_get_propertytdo_set_propertysGObject subclass %r defines do_get/set_property and it also uses a property with a custom setter or getter. This is not allowedcSs%|jjddƒ}t||dƒS(Nt-t_(R treplaceRbR(RtpspecR ((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pytobj_get_property¢scsD|jjddƒ}tˆ|dƒ}|r@|j||ƒndS(NRwRx(R RyRbRR3(RRzRCR tprop(tcls(s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pytobj_set_property§s(t__dict__RStitemsR'RR Rft
ValueErrortappendRtR=R0R3R1R)RRuRv(R}tgpropertiestpropsR R|R{R~((R}s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pytinstall_properties|s2		
$		(1tsysR?tgi._gitgit_giR;t
_constantsRRRRRRRRRR	R
RRR
RRRRRRRRRRRkRlRmRqRoRnRrRptversion_infoRYR(RhRgt
basestringtlongR!RR…(((s8/usr/lib64/python2.7/site-packages/gi/_propertyhelper.pyt<module>s(š									ÿJ

OHA YOOOO