Your IP : 3.147.84.33


Current Path : /lib64/python2.7/site-packages/gobject/
Upload File :
Current File : //lib64/python2.7/site-packages/gobject/propertyhelper.pyo

�
�uTc@s7ddlZddlZejdZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZddlmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ej%d	kre&Z'e(Z)ne*Z'e+Z)de,fd��YZ-dS(
i����Nsgobject._gobject(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_PYOBJECT(
t
G_MINFLOATt
G_MAXFLOATtG_MINDOUBLEtG_MAXDOUBLEtG_MININTtG_MAXINTt	G_MAXUINTt	G_MINLONGt	G_MAXLONGt
G_MAXULONGiitpropertyc
Bs�eZdZdefd��YZddddddejddd�	Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�ZRS(s�
    Creates a new property which in conjunction with GObject subclass will
    create a property proxy:

    >>> class MyObject(gobject.GObject):
    >>> ... prop = gobject.property(type=str)

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

    >>> obj.prop
    'value'

    The API is similar to the builtin property:

    class AnotherObject(gobject.GObject):
        @gobject.property
        def prop(self):
            return ...

    Which will create a read-only property called prop.
    t
__metaclass__cBseZd�ZRS(cCsdS(Ns<class 'gobject.property'>((tself((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyt__repr__Gs(t__name__t
__module__R"(((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR Fstc

Cs�|r|r|j}n<|r2|r2|j}n#|rU|rU|j}|j}n||_||_|dkr|t}n|j|�|_	|j
|�|_|j�t
|t�s�td��n||_t
|t�s�td��n||_|dks|dkr&td|f��n||_|dk	rr||j�kr~td|j	|j�f��q~n|j�}||_|	dk	r�|	|j�kr�td|j	|j�f��q�n|j�}	|	|_d|_d|_dS(	s`
        @param  getter: getter to get the value of the property
        @type   getter: callable
        @param  setter: setter to set the value of the property
        @type   setter: callable
        @param    type: type of property
        @type     type: type
        @param default: default value
        @param    nick: short description
        @type     bick: string
        @param   blurb: long description
        @type    blurb: string
        @param flags:    parameter flags, one of:
        - gobject.PARAM_READABLE
        - gobject.PARAM_READWRITE
        - gobject.PARAM_WRITABLE
        - gobject.PARAM_CONSTRUCT
        - gobject.PARAM_CONSTRUCT_ONLY
        - gobject.PARAM_LAX_VALIDATION
        @keyword minimum:  minimum allowed value (int, float, long only)
        @keyword maximum:  maximum allowed value (int, float, long only)
        snick must be a stringsblurb must be a stringii sinvalid flag value: %rs+Minimum for type %s cannot be lower than %ds,Maximum for type %s cannot be higher than %dN(t_readonly_settert_writeonly_gettert_default_gettert_default_settertgettertsettertNonetobjectt_type_from_pythonttypet_get_defaulttdefaultt_check_defaultt
isinstancet_basestringt	TypeErrortnicktblurbtflagst_get_minimumtminimumt_get_maximumtmaximumtnamet_exc(
R!R*R+R/R1R6R7R8R:R<((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyt__init__JsN

				
						cCs#d|jpdtj|j�fS(Ns<gobject property %s (%s)>s(uninitialized)(R=t_gobjectt	type_nameR/(R!((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR"�scCsS|dkr|Sd|_|j|j�}|jrO|j}d|_|�n|S(N(R,R>tget_propertyR=(R!tinstancetklasstvaluetexc((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyt__get__�s					cCsY|dkrt�nd|_|j|j|�|jrU|j}d|_|�ndS(N(R,R5R>tset_propertyR=(R!RCRERF((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyt__set__�s					cCs�|tkrtS|tkr tS|tkr0tS|tkr@tS|tkrPt	S|t
kr`tSt|t
�r�t|tj�r�|jS|ttttttttttttttttttt t	tgkr�|St!d|f��dS(NsUnsupported type: %r("t_longRtintRtboolRtfloatRtstrRR-RR3R/t
issubclassR@tGObjectt	__gtype__RRRRRRR	R
RRR
RRRRR5(R!ttype_((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR.�s,!cCso|j}|dk	r|S|ttttttgkr;dS|tkrKdS|t	ksc|t
krgdSdSdS(NiR%g(R/R,RRRRR	R
RR
R(R!R1tptype((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR0�s	cCst|j}|j}|tkrF|ttfkrFtd|f��n*|tkrp|dk	rptd��qpndS(Ns%default must be True or False, not %rs)object types does not have default values(R/R1RtTruetFalseR5RR,(R!RSR1((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR2�s		cCsx|j}|tttgkr"dS|tkr3tS|tkrDtS|tkrTt	S|t
krdtS|tkrtdSdS(Niii>iI@I�I��������(R/RRR
R
RRRRRRRR	R,(R!RS((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR9�s	cCs�|j}|tkrtS|tkr)tS|tkr9dS|tkrIdS|tkrYtS|t	krit
S|tkrytS|t
kr�tSdS(	Nii>ii?I@I�������?ll����(R/RRRRR	R
R
RRRRRRRR,(R!RS((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR;�s$	cCst|d|j|�dS(Nt_property_helper_(tsetattrR=(R!RCRE((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR)scCst|d|j|j�S(NRV(tgetattrR=R1(R!RC((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR(scCs)td|jt|�jf�|_dS(Ns%s property of %s is read-only(R5R=R/R#R>(R!RCRE((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR&scCs)td|jt|�jf�|_dS(Ns%s property of %s is write-only(R5R=R/R#R>(R!RC((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR'sc	Cs�|j}|ttttttttgkrN|j	�|j
�|jf}n`|tksf|t
kru|jf}n9|tkr�d}n$|jt�r�d}nt|��|j|j|jf||jfS(N(((R/RRRRR	R
R
RR9R;R1RRRtis_aRtNotImplementedErrorR6R7R8(R!RStargs((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pytget_pspec_args!s	!		N(R#R$t__doc__R/R R,R@tPARAM_READWRITER?R"RGRIR.R0R2R9R;R)R(R&R'R\(((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyR.s$I		
				
						(ii(.tsystgobject._gobjecttgobjecttmodulesR@tgobject.constantsRRRRRRRRRR	R
RRR
RRRRRRRRRRRRRRRRRtversion_infoRNR4RKRJt
basestringtlongR-R(((s</usr/lib64/python2.7/site-packages/gobject/propertyhelper.pyt<module>s
�F