grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a bê²^S7ã@sÀddlmZddlmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZejZejZejZejZejZej Z ej!Z!ej"Z"Gdd„de#ƒZ$dd„Z%dS)é)Ú_gi)Ú TYPE_NONEÚTYPE_INTERFACEÚ TYPE_CHARÚ TYPE_UCHARÚ TYPE_BOOLEANÚTYPE_INTÚ TYPE_UINTÚ TYPE_LONGÚ TYPE_ULONGÚ TYPE_INT64Ú TYPE_UINT64Ú TYPE_ENUMÚ TYPE_FLAGSÚ TYPE_FLOATÚ TYPE_DOUBLEÚ TYPE_STRINGÚ TYPE_POINTERÚ TYPE_BOXEDÚ TYPE_PARAMÚ TYPE_OBJECTÚ TYPE_PYOBJECTÚ TYPE_GTYPEÚ TYPE_STRVÚ TYPE_VARIANTc@sJeZdZdZeeeeee e e e e iZedededee e e eeeeediZeeeeededeee eeeeeiZedededededede dede di ZGdd „d e ƒZ!d d d d dde"j#d d f d d „Z$d d„Z%dd„Z&dd„Z'dd„Z(dd„Z)dd„Z*dd„Z+dd„Z,dd„Z-dd „Z.d!d"„Z/d#d$„Z0d%d&„Z1d'd(„Z2d)d*„Z3d+d,„Z4d S)-ÚPropertyaÄ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 élûÿÿÿlÿÿÿÿlÿÿÿÿÚgc@seZdZdd„ZdS)zProperty.__metaclass__cCsdS)Nz©©Úselfrrú8/usr/lib64/python3.9/site-packages/gi/_propertyhelper.pyÚ__repr__ŠszProperty.__metaclass__.__repr__N)Ú__name__Ú __module__Ú __qualname__r"rrrr!Ú __metaclass__‰sr&Nc Cs4d|_|durt}| |¡|_| |¡|_| ¡t|tƒsDt dƒ‚||_ t|tƒs\t dƒ‚||_ ||_ ||_ |r~|s~|j}n$|rŽ|sŽ|j}n|s¢|s¢|j}|j}| |¡||_|durÞ|| ¡kræt d|j| ¡fƒ‚n| ¡}||_| du�r| | ¡k�r$t d|j| ¡fƒ‚n| ¡} | |_d|_dS)Nznick must be a stringzblurb must be a stringz+Minimum for type %s cannot be lower than %dz,Maximum for type %s cannot be higher than %d)ÚnameÚobjectÚ_type_from_pythonÚtypeÚ _get_defaultÚdefaultÚ_check_defaultÚ isinstanceÚstrÚ TypeErrorÚnickÚblurbÚ__doc__ÚflagsÚ_readonly_setterÚ_writeonly_getterÚ_default_getterÚ_default_setterÚgetterÚfsetÚ _get_minimumÚminimumÚ _get_maximumÚmaximumÚ_exc) r r9Úsetterr*r,r1r2r4r<r>rrr!Ú__init__�sT       ÿÿ  ÿÿzProperty.__init__cCsd|jp d|jjfS)Nzz(uninitialized))r'r*rrrr!r"ÅsþzProperty.__repr__cCs6|dur |Sd|_| |¡}|jr2|j}d|_|‚|S©N)r?Úfget)r ÚinstanceÚklassÚvalueÚexcrrr!Ú__get__Ês zProperty.__get__cCs:|dur t‚d|_| |j|¡|jr6|j}d|_|‚dSrB)r0r?Z set_propertyr')r rDrFrGrrr!Ú__set__×szProperty.__set__cCs | |¡S)z;Allows application of the getter along with init arguments.)r9©r rCrrr!Ú__call__âszProperty.__call__cCs |jr|j|_|j|_||_|S)z8Set the getter function to fget. For use as a decorator.)r3r2rCrJrrr!r9æs zProperty.gettercCs||_|js|jj|_|S)z8Set the setter function to fset. For use as a decorator.)r:r'rCr#)r r:rrr!r@ïs zProperty.settercCsŒ||jvr|j|St|tƒrBt|tjtjtjtjtj fƒrB|j S|t t t ttttttttttttttttttt fvrz|St!d|fƒ‚dS)NzUnsupported type: %r)"Ú_type_from_pytype_lookupr.r*Ú issubclassrZGObjectZGEnumZGFlagsZGBoxedZ GInterfaceÚ __gtype__rrrrrr rr r r r rrrrrrrrrrrr0)r Útype_rrr!r)ùs(   üÿ ûzProperty._type_from_pythoncCs|dur |S|j |jd¡SrB)Ú_default_lookupÚgetr*)r r,rrr!r+ szProperty._get_defaultcCsz|j}|j}|tkr.|dvr.td|fƒ‚�nH|tkrJ|durFtdƒ‚�n,|tkrf|durbtdƒ‚�n| t¡r¤|dur‚tdƒ‚n t  |¡ |¡s¢td||fƒ‚nÒ| t ¡rÐt  |¡ |¡sÎtd||fƒ‚n¦| t ¡�r2|du�r2t |t ƒ�stdt|ƒƒ‚|D](}t|ƒttfv�rtd t|ƒƒ‚�qnD| t¡�rv|du�rvt|d ƒ�rft  |¡ t¡�svtd ||fƒ‚dS) N)TFz%default must be True or False, not %rz)object types does not have default valuesz(GType types does not have default valuesz%enum properties needs a default valuez'enum value %s must be an instance of %rz(flags value %s must be an instance of %rzStrv value %s must be a listz'Strv value %s must contain only stringsrNz*variant value %s must be an instance of %r)r*r,rr0rrÚis_arrZGTyperrr.ÚlistÚreprr/ÚbytesrÚhasattr)r Úptyper,Úvalrrr!r-sFÿ    ÿ ÿ ÿzProperty._check_defaultcCs|j |jd¡SrB)Ú_min_value_lookuprQr*rrrr!r;3szProperty._get_minimumcCs|j |jd¡SrB)Ú_max_value_lookuprQr*rrrr!r=6szProperty._get_maximumcCst|d|j|ƒdS©NZ_property_helper_)Úsetattrr'©r rDrFrrr!r8=szProperty._default_settercCst|d|j|jƒSr[)Úgetattrr'r,©r rDrrr!r7@szProperty._default_gettercCstd|jt|ƒjfƒ|_dS)Nz%s property of %s is read-only©r0r'r*r#r?r]rrr!r5Cs ÿzProperty._readonly_settercCstd|jt|ƒjfƒ|_dS)Nz%s property of %s is write-onlyr`r_rrr!r6Gs ÿzProperty._writeonly_getterc Cs¸|j}|ttttttttfvr0|j |j |j f}nl|t ks^|t ks^| t¡s^| t¡s^| t¡rh|j f}n4|ttfvrzd}n"| t¡sŽ| t¡r”d}nt|ƒ‚|j|j|jf||jfS)Nr)r*rr r r r r rrr<r>r,rrrRrrrrrrrÚNotImplementedErrorr1r2r4)r rWÚargsrrr!Úget_pspec_argsOs& ÿÿÿþ  zProperty.get_pspec_args)5r#r$r%r3ÚintrÚboolrÚfloatrr/rr(rrLr r r rÚ G_MAXFLOATÚ G_MAXDOUBLEÚG_MININTr Ú G_MINLONGr rYÚ G_MAXUINTÚ G_MAXULONGÚG_MAXINTÚ G_MAXLONGrZrPr*r&rZPARAM_READWRITErAr"rHrIrKr9r@r)r+r-r;r=r8r7r5r6rcrrrr!r'sp7û ÷ ø ÷ þ 8    !rcsøˆj di¡}g}ˆj ¡D]b\}}t|tƒr|js:||_|j|vrf||j| ¡krXqtd|jƒ‚| ¡||j<| |¡q|sˆdS|ˆ_ dˆjvs¢dˆjvrÔ|D],}|j |j ksÂ|j |j kr¦tdˆjfƒ‚q¦dd„}|ˆ_‡fd d „}|ˆ_dS) z“ Scans the given class for instances of Property and merges them into the classes __gproperties__ dict if it exists or adds it if not. Ú__gproperties__z0Property %s was already found in __gproperties__NÚdo_get_propertyÚdo_set_propertyzGObject subclass %r defines do_get/set_property and it also uses a property with a custom setter or getter. This is not allowedcSs|j dd¡}t||dƒS©Nú-Ú_)r'Úreplacer^)r Úpspecr'rrr!Úobj_get_propertyˆsz,install_properties..obj_get_propertycs.|j dd¡}tˆ|dƒ}|r*| ||¡dSrr)r'rur^r:)r rvrFr'Úprop©Úclsrr!Úobj_set_property�s z,install_properties..obj_set_property)Ú__dict__rQÚitemsr.rr'rcÚ ValueErrorÚappendrorCr7r:r8r0r#rprq)rzZ gpropertiesZpropsr'rxrwr{rryr!Úinstall_propertiesbs6   ýÿ r€N)&rrZ _constantsrrrrrrr r r r r rrrrrrrrrrrrrrgrhrirmrkrjrnrlr(rr€rrrr!Ús h=