%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/gi/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/gi/__pycache__/_propertyhelper.cpython-312.pyc

�

��fS7��T�ddlmZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZej6Zej8Zej:Zej<Zej>Zej@Z ejBZ!ejDZ"Gd�de#�Z$d�Z%y)�)�_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�@�eZdZdZeeeeee	e
eee
iZedededeee	eeeeeediZeeeeededeee	eeeeeiZedededededededede	di	ZGd�d	e �Z!d
d
d
d
dde"jFd
d
f	d�Z$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�Z4y
)�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��eZdZd�Zy)�Property.__metaclass__c��y)Nz<class 'GObject.Property'>���selfs �4/usr/lib/python3/dist-packages/gi/_propertyhelper.py�__repr__zProperty.__metaclass__.__repr__�s��/�N)�__name__�
__module__�__qualname__r'r#r(r&�
__metaclass__r!�s��	0r(r,Nc
�H�d|_|�t}|j|�|_|j	|�|_|j
�t|t�std��||_
t|t�std��||_||_||_
|r|s
|j}n-|r|s
|j}n|s|s|j }|j"}|j%|�||_|�;||j)�kr8td|j|j)�fz��|j)�}||_|	�;|	|j-�kDr8td|j|j-�fz��|j-�}	|	|_d|_y)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%r@�setterr1r3r8r9r;rCrEs
          r&�__init__zProperty.__init__�s�����	��<��D��*�*�4�0��	��(�(��1��������$��$��3�4�4���	��%��%��4�5�5���
������
��&��*�*�F�
�F��+�+�F����)�)�F��)�)�F����F����	�����*�*�,�,��A��Y�Y�� 1� 1� 3�4�5�6�6��'�'�)�G��������*�*�,�,��B��Y�Y�� 1� 1� 3�4�5�6�6��'�'�)�G������	r(c�X�d|jxsd�d|jj�d�S)Nz<GObject Property z(uninitialized)z (z)>)r.r1r$s r&r'zProperty.__repr__�s'���I�I�*�*�*��I�I�N�N��	r(c��|�|Sd|_|j|�}|jr|j}d|_|�|S�N)rF�fget)r%�instance�klass�value�excs     r&�__get__zProperty.__get__�sC�����K���	��	�	�(�#���9�9��)�)�C��D�I��I��r(c��|�t�d|_|j|j|�|jr|j}d|_|�yrK)r7rF�set_propertyr.)r%rMrOrPs    r&�__set__zProperty.__set__�sI�����O���	����d�i�i��/��9�9��)�)�C��D�I��I�r(c�$�|j|�S)z;Allows application of the getter along with init arguments.)r@�r%rLs  r&�__call__zProperty.__call__�s���{�{�4� � r(c�p�|jr"|j|_|j|_||_|S)z8Set the getter function to fget. For use as a decorator.)r:r9rLrVs  r&r@zProperty.getter�s+���<�<����D�J��<�<�D�L���	��r(c�b�||_|js|jj|_|S)z8Set the setter function to fset. For use as a decorator.)rAr.rLr))r%rAs  r&rGzProperty.setter�s(����	��y�y��	�	�*�*�D�I��r(c�&�||jvr|j|St|t�rct|tj
tjtjtjtjf�r|jS|tttttt t"t$t&t(t*t,t.t0t2t4t6t8t:t<t>t@fvr|StCd|����)NzUnsupported type: )"�_type_from_pytype_lookupr5r1�
issubclassr�GObject�GEnum�GFlags�GBoxed�
GInterface�	__gtype__rrrrr	r
rrrr
rrrrrrrrrrrrr7)r%�type_s  r&r0zProperty._type_from_python�s����D�1�1�1��0�0��7�7����%������!$���!$���!$���!$���	!1�2�
�?�?�"�
�y�.�)�Z���L�)�!�:�{�!�;��!�:�{�K�$�j�)�\�K�K��L��e�=�>�>r(c�V�|�|S|jj|jd�SrK)�_default_lookup�getr1)r%r3s  r&r2zProperty._get_default
s*�����N��#�#�'�'��	�	�4�8�8r(c��|j}|j}|tk(r|dvrtd|����|tk(r|�td��y|t
k(r|�td��y|j
t�rC|�td��tj|�j
|�std|�d|����y|j
t�r6tj|�j
|�std|�d|����y|j
t�r_|�]t|t�std	t|�z��|D]0}t|�tt fvs�td
t|�z��y|j
t"�rI|�Ft%|d�r(tj|�j
t"�std|�d|����yyy)
N)TFz#default must be True or False, not z)object types does not have default valuesz(GType types does not have default valuesz%enum properties needs a default valuezenum value z must be an instance of zflags value zStrv value %s must be a listz'Strv value %s must contain only stringsrbzvariant value )r1r3rr7rr�is_arr�GTyperrr5�list�reprr6�bytesr�hasattr)r%�ptyper3�vals    r&r4zProperty._check_defaults����	�	���,�,���\�!�w�m�'C��;B�D�F�
F�
�m�
#��"�� K�L�L�#�
�j�
 ��"�� J�K�K�#�
�Z�Z�	�
"���� G�H�H��Y�Y�w�'�,�,�U�3��!(�%�!1�2�2�4��Z�Z�
�
#��9�9�W�%�*�*�5�1��!(�%�!1�2�2�2��Z�Z�	�
"�w�':��g�t�,�� >��g�� N�O�O��
^����9�S�%�L�0�#�$M�PS�T[�P\�$\�]�]�
^��Z�Z��
%�'�*=��7�K�0��	�	�'�8J�8O�8O�P\�8]��!(�%�!1�2�2�9^�+>�
%r(c�N�|jj|jd�SrK)�_min_value_lookuprfr1r$s r&rBzProperty._get_minimum3����%�%�)�)�$�)�)�T�:�:r(c�N�|jj|jd�SrK)�_max_value_lookuprfr1r$s r&rDzProperty._get_maximum6rrr(c�8�t|d|jz|�y�N�_property_helper_)�setattrr.�r%rMrOs   r&r?zProperty._default_setter=s����-��	�	�9�5�Ar(c�J�t|d|jz|j�Srv)�getattrr.r3�r%rMs  r&r>zProperty._default_getter@s���x�!4�t�y�y�!@�$�,�,�O�Or(c�j�t|j�dt|�j�d��|_y)N�
 property of z
 is read-only�r7r.r1r)rFrys   r&r<zProperty._readonly_setterC�&����I�I�t�H�~�.�.�0�1��	r(c�j�t|j�dt|�j�d��|_y)Nr~z is write-onlyrr|s  r&r=zProperty._writeonly_getterGr�r(c	�r�|j}|ttttt
tttfvr$|j|j|jf}n�|tk(sH|tk(s?|jt�s*|jt �s|jt"�r|jf}nI|t$t&fvrd}n8|jt(�s|jt*�rd}nt-|��|j|j.|j0f|z|j2fzS)Nr#)r1r	r
rrr
rrrrCrEr3rrrhrrrrrrr�NotImplementedErrorr8r9r;)r%rn�argss   r&�get_pspec_argszProperty.get_pspec_argsOs����	�	���X�y�)�Z���j�+�G�G��<�<����t�|�|�;�D��{�"�e�|�&;��j�j��#�u�z�z�*�'=��j�j��&��L�L�?�D�
�}�j�1�
1��D�
�Z�Z��
$��
�
�:�(>��D�%�e�,�,��	�	�4�9�9�d�j�j�1�D�8�D�J�J�=�H�Hr()5r)r*r+r:�intr	�boolr�floatrr6rr/rr[r
rrr�
G_MAXFLOAT�G_MAXDOUBLE�G_MININTr�	G_MINLONGr
rq�	G_MAXUINT�
G_MAXULONG�G_MAXINT�	G_MAXLONGrtrer1r,r�PARAM_READWRITErHr'rQrTrWr@rGr0r2r4rBrDr?r>r<r=r�r#r(r&rr'sL��5�n	�X��l�
�{��[��
� ��	�1��A��Q��Z�K��k�\��(��9��H�
��	�9��J��K��[��J��[��(��9�	��	�!��1��1��A��A��Q��R��C��S�
�O�0��0�#�4�d�D���#�*=�*=��t�6�p�
�	�!���?�(9�
2�B;�;�B�P�1�1�Ir(rc�����jjdi�}g}�jj�D]�\}}t|t�s�|j
s||_|j
|vr9||j
|j
�k(r�Ytd|j
z��|j
�||j
<|j|���|sy|�_	d�jvsd�jvrR|D]M}|j|jk7s|j|jk7s�6td�j�d���d�}|�_�fd	�}|�_y)
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 zl defines do_get/set_property and it also uses a property with a custom setter or getter. This is not allowedc�T�|jjdd�}t||d�S�N�-�_)r.�replacer{)r%�pspecr.s   r&�obj_get_propertyz,install_properties.<locals>.obj_get_property�s'���z�z�!�!�#�s�+���t�T�4�(�(r(c���|jjdd�}t�|d�}|r|j||�yyr�)r.r�r{rA)r%r�rOr.�prop�clss     �r&�obj_set_propertyz,install_properties.<locals>.obj_set_property�s=����z�z�!�!�#�s�+���s�D�$�'����I�I�d�E�"�r()�__dict__rf�itemsr5rr.r��
ValueError�appendr�rLr>rAr?r7r)r�r�)r��gproperties�propsr.r�r�r�s`      r&�install_propertiesr�bsT���
�,�,�"�"�#4�b�9�K��E��l�l�(�(�*��
��d��d�H�%��9�9� ��	��y�y�K�'��t�y�y�)�T�-@�-@�-B�B�� �!S�VZ�V_�V_�!_�`�`�%)�%8�%8�%:�K��	�	�"��L�L���� ��%�C���C�L�L�(�,=����,M��	%�D��y�y�D�0�0�0�D�I�I��AU�AU�4U���\�\�$�%�%�	%�)�+�C��#�
+�C�r(N)&rr�
_constantsrrrrrr	r
rrr
rrrrrrrrrrrrrrr�r�r�r�r�r�r�r�r/rr�r#r(r&�<module>r�s���(�7�7�7�7�7�7�7��^�^�
��o�o���<�<���<�<���M�M�	��M�M�	��M�M�	�
�^�^�
�xI�v�xI�v	0+r(

Zerion Mini Shell 1.0