%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/zope/interface/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/zope/interface/__pycache__/declarations.cpython-312.pyc

�

��e����t�dZdZddlZddlmZddlmZddlmZddlZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
ddlmZgZiZd
�ZGd�d�ZGd�de�ZGd�de�ZGd�de
e�Zd�Zd�Zed��Zd�Zd�Zd�Zd7d�Zd�ZGd�d�ZGd �d!�Z Gd"�d#e�Z!e!Z"ejF�Z$d$�Z!d%e!_%d&�Z&d'�Z'd(�Z(eGd)�d*e��Z)Gd+�d,ee)�Z*d-�Z+Gd.�d/�Z,d0�Z-d1�Z.ed2��Z/ed3��Z0eGd4�d5��Z1d8d6�Z2e�Z3e1�Z4y)9a�Implementation of interface declarations

There are three flavors of declarations:

  - Declarations are used to simply name declared interfaces.

  - ImplementsDeclarations are used to express the interfaces that a
    class implements (that instances of the class provides).

    Implements specifications support inheriting interfaces.

  - ProvidesDeclarations are used to express interfaces directly
    provided by objects.

�restructuredtext�N)�FunctionType)�
MethodType)�
ModuleType)�	Interface)�InterfaceClass)�SpecificationBase)�
Specification)�NameAndModuleComparisonMixin)�_use_c_implc�|�|j}|j}|j}||j|�dz}|S)N�)�__self_class__�
__thisclass__�__mro__�index)�ob�
self_class�class_that_invoked_super�complete_mro�
next_classs     �=/usr/lib/python3/dist-packages/zope/interface/declarations.py�_next_super_classr5sG���"�"�J�!�/�/���%�%�L��l�0�0�1I�J�Q�N�O�J���c��eZdZd�Zd�Zy)�namedc��||_y�N)�name)�selfrs  r�__init__znamed.__init__As	����	rc�(�|j|_|Sr)r�__component_name__�r rs  r�__call__znamed.__call__Ds�� $�	�	����	rN)�__name__�
__module__�__qualname__r!r%�rrrr?s���rrc�\�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
e
Zed	��Z
ed
��Zy)�DeclarationzInterface declarationsr)c�B�tj|t|��yr)r
r!�_normalizeargs)r �basess  rr!zDeclaration.__init__Ns�����t�^�E�%:�;rc�L�|j|�xr||j�vS)z:Test whether an interface is in the specification
        )�extends�
interfaces)r �	interfaces  r�__contains__zDeclaration.__contains__Qs$���|�|�I�&�I�9����8I�+I�Irc�"�|j�S)zCReturn an iterator for the interfaces in the specification
        �r1�r s r�__iter__zDeclaration.__iter__Ws����� � rc�,�t|j�S)zCReturn an iterator of all included and extended interfaces
        )�iter�__iro__r6s r�	flattenedzDeclaration.flattened\s���D�L�L�!�!rc
���t|j�D��cgc]4}|j�D�cgc]}|j|d�r|��c}s|��6c}}�Scc}wcc}}w)z/Remove interfaces from a specification
        r)r+r1r0)r �other�i�js    r�__sub__zDeclaration.__sub__asf������(�
���)�)�+����9�9�Q��?���
�
��	����
s�A
�A�A
�A
c�*��g}t|j��}t|�}|j�D]O��|vr�|j��t	�fd�|D��r|j���?|j���Qt
||z�S)a�
        Add two specifications or a specification and an interface
        and produce a new declaration.

        .. versionchanged:: 5.4.0
           Now tries to preserve a consistent resolution order. Interfaces
           being added to this object are added to the front of the resulting resolution
           order if they already extend an interface in this object. Previously,
           they were always added to the end of the order, which easily resulted in
           invalid orders.
        c3�@�K�|]}�j|����y�wr)r0)�.0�xr>s  �r�	<genexpr>z&Declaration.__add__.<locals>.<genexpr>�s�����0�A�1�9�9�Q�<�0�s�)�listr1�set�add�any�appendr+)r r=�before�result�seenr>s     @r�__add__zDeclaration.__add__ms�������d�o�o�'�(���6�{���!�!�#�		!�A��D�y���H�H�Q�K��0��0�0��
�
�a� ��
�
�a� �		!��V�f�_�.�.rc��t|�}t|D�cgc]}|j|�s|��c}�}||fzScc}wr)�
implementedBy�tuple�isOrExtends)r1�cls�implemented_by_cls�ifaces    r�_add_interfaces_to_clsz"Declaration._add_interfaces_to_cls�sS��
+�3�/���#�
��%�1�1�%�8�
�
��
�
�/�1�1�1��
s�<c��g}t�}|D]�}t}t|t�r|j}t
}nYt|t�r|j}t}n6t|t�r|js|j|vr�zt|�}||v}|j|�|r||�}|j|���dj|�S)N�, )rG�repr�
isinstancerr&�str�type�_implements_name�
Implements�declared�inheritrHrJ�join)r1�
ordered_names�namesrU�duplicate_transform�	this_name�already_seens       r�_argument_names_for_reprz$Declaration._argument_names_for_repr�s���
�
�����	,�E�"&���%��0�"�N�N�	�&)�#��E�4�(�"�N�N�	�&6�#��U�J�/��.�.��m�m�z�1�� ��K�	�$��-�L��I�I�i� ��/��6�	�� � ��+�7	,�8�y�y��'�'rN)r&r'r(�__doc__�	__slots__r!r3r7r;r@rN�__radd__�staticmethodrVrgr)rrr+r+IsV�� ��I�<�J�!�
"�

�/�<�H��
2��
2��"(��"(rr+c���eZdZdZdZd�Zd�Zed��Zejd��Zed��Z
d�xZxZZ
d	�Zdd
�Zdd�Zdd�Zed
��Zejd��Zy)�_ImmutableDeclarationr)Nc�~�tj�tj|�t_tjSr)rm�_ImmutableDeclaration__instance�object�__new__)rSs rrqz_ImmutableDeclaration.__new__�s,�� �+�+�3�/5�~�~�c�/B�!�,�$�/�/�/rc��y)N�_emptyr)r6s r�
__reduce__z _ImmutableDeclaration.__reduce__�s��rc��y�Nr)r)r6s r�	__bases__z_ImmutableDeclaration.__bases__�s��rc�$�|dk7rtd��y)Nr)z7Cannot set non-empty bases on shared empty Declaration.)�	TypeError)r �	new_basess  rrwz_ImmutableDeclaration.__bases__�s����?��U�V�V�rc��iSrr)r6s r�
dependentsz _ImmutableDeclaration.dependents�s���	rc��yrr))r �_ignoreds  r�<lambda>z_ImmutableDeclaration.<lambda>�s�rc��td�Srv)r9r6s rr1z _ImmutableDeclaration.interfaces�s���B�x�rc��||juSr)�_ROOT)r r2�stricts   rr0z_ImmutableDeclaration.extends�s���D�J�J�&�&rc��|Srr))r r�defaults   r�getz_ImmutableDeclaration.get�s���rc��tSr)rm)r �callbacks  r�weakrefz_ImmutableDeclaration.weakref�s
��%�$rc��iSrr)r6s r�_v_attrsz_ImmutableDeclaration._v_attrss	���	rc��yrr))r �	new_attrss  rr�z_ImmutableDeclaration._v_attrss��r)Tr)r&r'r(rirorqrt�propertyrw�setterr|�changed�	subscribe�unsubscriber1r0r�r�r�r)rrrmrm�s����I��J�0�
��������W��W�����)D�C�G�C�i�+��'��%������_�_�
��
rrmc�J��eZdZdZdZdZdZed��Z�fd�Zd�Z	d�Z
�xZS)r^Nr)�?c�T�|j|�}||_|j|�|Sr)rqr&r!)rSrr.�insts    rrzImplements.named9s,���{�{�3�����
���
�
�u���rc�F��	|`t�|�
|�S#t$rY�wxYwr)�_super_cache�AttributeError�superr�)r �originally_changed�	__class__s  �rr�zImplements.changedEs4���	��!��w��1�2�2���	��	�s��	 � c��|jr/t|jdd�xst|j�}n|j}|j	|j
�}|rd|z}dj
||�S)Nr&rXzclassImplements({}{}))r`�getattrr]r&rgr_�format)r r�declared_namess   r�__repr__zImplements.__repr__Lsg���<�<��4�<�<��T�:�\�>N�t�|�|�>\�D��=�=�D��6�6�t�}�}�E���!�N�2�N�&�-�-�d�N�C�Crc�(�t|jffSr)rPr`r6s rrtzImplements.__reduce__Vs���t�|�|�.�.�.r)r&r'r(r`r_r��classmethodrr�r�rt�
__classcell__)r�s@rr^r^s?���2�G��H��L��H��	��	�3�D�/rr^c�N�t|dd�xsddzt|dd�xsdzS)Nr'r��.r&)r�)rs rr]r]Zs8��
�B��c�*�1�c����r�:�s�+�2�s�4�4rc�2�t|j�}|j}|�tj�x}|_|j
}	||S#t$rYnwxYwt|�}t|�}|jj}|j|�}||d}|D�	cgc]
}	t|	���ncc}	w}
}	tj|jdz|jzg|
���}|j|_
|j|_|||<|S)N�:)rPrr�r��WeakKeyDictionaryr�KeyErrorrrrr^rr&r`r_)�sup�implemented_by_self�cache�key�next_cls�implemented_by_next�mro�ix_next_cls�classes_to_keep�crz�news            r�_implementedBy_superr�gs%��(��(:�(:�;���,�,�E��}�3:�3L�3L�3N�N��#�0�

�
�
�C�
��S�z����
��
��!��%�H�
(��1��

�
�
�
$�
$�C��)�)�H�%�K��+�,�'�O�+:�;�a��q�!�;��;�I�;�
�
�
��$�$�s�*�-@�-I�-I�I��	��C�&�-�-�C�K�&�/�/�C�L��E�#�J��Js�A�	A�A�&B9c
� �	t|t�rt|�S|jj	d�}t|t�r|S|�tj	|�}|�|St|�}|�,|f}tj|gt|����}d|_|`nA	|j"}tj|g|D�cgc]
}t)|���c}���}||_	||_t+|d�st,|_t|t0�r3d|jvr%t3|t
|dt1|���|_|S#t
$r^t
|dd�}|�#tj	|�}|�|cYStcYS|jtk(r|cYStt|f��cYSwxYw#t
$rt%|�st'd|��d}Y��'wxYwcc}w#t&$r)t|t0�st'd|��|t|<Y|SwxYw)	z�Return the interfaces implemented for a class' instances

      The value returned is an `~zope.interface.interfaces.IDeclaration`.
    �__implemented__Nz$ImplementedBy called for non-factoryr)�__providedBy__�__provides__r�z!ImplementedBy called for non-type)rZr�r��__dict__r�r�r��#BuiltinImplementationSpecificationsrsr�r^r+r-r]rr`r�rw�callableryrP�hasattr�objectSpecificationDescriptorr�r\�
ClassProvidesr�)rS�spec�	spec_namer.r�s     rrPrP�s��#6��c�5�!�(��,�,��|�|��� 1�2��>�$�
�#����|�2�6�6�s�;�����K�!��%�I����x�����	�A�N�4�,@�A�������	��M�M�E����	�N�u�,M�!�]�1�-=�,M�N�����8�"����s�,�-�!>�C���c�4� �^�3�<�<�%G�,����[�$�s�)�4� �C���K��U�6��s�-�t�4���<�6�:�:�3�?�D������M��>�>�Z�'��K�
�N�D�8�4�5�5�96��b�	��C�=�� F��L�L��E�	��
-N���8��#�t�$��?��E�E�37�+�C�0��K�8�sS�E�E�F-�G
� A!G�1F*�6F*�>F*�F*�)F*�-"G�G�.H
�H
c�^�t|�}d|_d|_d|_t	||d�y)a
    Declare the only interfaces implemented by instances of a class

    The arguments after the class are one or more interfaces or interface
    specifications (`~zope.interface.interfaces.IDeclaration` objects).

    The interfaces given (including the interfaces in the specifications)
    replace any previous declarations, *including* inherited definitions. If you
    wish to preserve inherited declarations, you can pass ``implementedBy(cls)``
    in *interfaces*. This can be used to alter the interface resolution order.
    r)N)rPr_r`rw�_classImplements_ordered)rSr1r�s   r�classImplementsOnlyr��s1�����D�
�D�M��D�L��D�N��T�:�r�2rc�"�t|�}tt|��}g}g}|D]H}|jD]&}|j	|�s�|j|��7|j|��Jt
|t|�t|��y)aN
    Declare additional interfaces implemented for instances of a class

    The arguments after the class are one or more interfaces or
    interface specifications (`~zope.interface.interfaces.IDeclaration` objects).

    The interfaces given (including the interfaces in the specifications)
    are added to any interfaces previously declared. An effort is made to
    keep a consistent C3 resolution order, but this cannot be guaranteed.

    .. versionchanged:: 5.0.0
       Each individual interface in *interfaces* may be added to either the
       beginning or end of the list of interfaces declared for *cls*,
       based on inheritance, in order to try to maintain a consistent
       resolution order. Previously, all interfaces were added to the end.
    .. versionchanged:: 5.1.0
       If *cls* is already declared to implement an interface (or derived interface)
       in *interfaces* through inheritance, the interface is ignored. Previously, it
       would redundantly be made direct base of *cls*, which often produced inconsistent
       interface resolution orders. Now, the order will be consistent, but may change.
       Also, if the ``__bases__`` of the *cls* are later changed, the *cls* will no
       longer be considered to implement such an interface (changing the ``__bases__`` of *cls*
       has never been supported).
    N)rPrQr-r_r0rJr�)rSr1r�rK�afterrU�bs       r�classImplementsr�s���2���D��~�j�1�2�J�
�F��E�
� �����	 �A��}�}�Q���
�
�e�$��	 �

�L�L���
 ��T�5��=�%��,�?rc�6�t|�}t||fd�y)a-
    Declare that instances of *cls* additionally provide *iface*.

    The second argument is an interface or interface specification.
    It is added as the highest priority (first in the IRO) interface;
    no attempt is made to keep a consistent resolution order.

    .. versionadded:: 5.0.0
    r)N)rPr�)rSrUr�s   r�classImplementsFirstr�3s�����D��T�E�8�R�0rc�z�|D�cgc])}|j|�r|tur|js|��+}}|D�cgc])}|j|�r|tur|js|��+}}g}t�}||j|fD]0}|D])}||vs�|j	|�|j|��+�2t
|�|_|}|j�M|jjD]4}	t|	�}||vs�|j|�|j	|��6t
|�|_ycc}wcc}wr)
rRrr_rGrJrHrQr`rwrP)
r�rKr�rD�new_declaredrM�lr�r.r�s
          rr�r�AsB����
�����"�q�I�~�d�m�m�	
��F���
�
�����"�q�I�~�d�m�m�	
�
�E�
��L��5�D�
�T�]�]�E�
)����	�A���}��#�#�A�&������	���,�'�D�M�
�E��|�|�����'�'�	 �A��a� �A���}���������Q��		 ��5�\�D�N��A��

s
�.D3�.D8c�@�|jd\}}|`||g|���|S)N�__implements_advice_data__)r�r�)rSr1�do_classImplementss   r�_implements_advicer�js/��%(�\�\�2N�%O�"�J�"��&��s�(�Z�(��Jrc� �eZdZdZdZd�Zd�Zy)�implementera�
    Declare the interfaces implemented by instances of a class.

    This function is called as a class decorator.

    The arguments are one or more interfaces or interface
    specifications (`~zope.interface.interfaces.IDeclaration`
    objects).

    The interfaces given (including the interfaces in the
    specifications) are added to any interfaces previously declared,
    unless the interface is already implemented.

    Previous declarations include declarations for base classes unless
    implementsOnly was used.

    This function is provided for convenience. It provides a more
    convenient way to call `classImplements`. For example::

        @implementer(I1)
        class C(object):
            pass

    is equivalent to calling::

        classImplements(C, I1)

    after the class has been created.

    .. seealso:: `classImplements`
       The change history provided there applies to this function too.
    r5c��||_yrr5�r r1s  rr!zimplementer.__init__��	��$��rc���t|t�rt|g|j���|St	|�}tj|g|j���}	||_|S#t$r
td|��wxYw)NzCan't declare implements)
rZr\r�r1r]r^rr�r�ry)r rr�r�s    rr%zimplementer.__call__�sx���b�$���B�1����1��I�$�R�(�	����	�<�D�O�O�<��	<�!%�B���	���	<��6��;�;�	<�s�A�A4N)r&r'r(rhrir!r%r)rrr�r�qs���@ �I�%�rr�c��eZdZdZd�Zd�Zy)�implementer_onlya�Declare the only interfaces implemented by instances of a class

      This function is called as a class decorator.

      The arguments are one or more interfaces or interface
      specifications (`~zope.interface.interfaces.IDeclaration` objects).

      Previous declarations including declarations for base classes
      are overridden.

      This function is provided for convenience. It provides a more
      convenient way to call `classImplementsOnly`. For example::

        @implementer_only(I1)
        class C(object): pass

      is equivalent to calling::

        classImplementsOnly(I1)

      after the class has been created.
      c��||_yrr5r�s  rr!zimplementer_only.__init__�r�rc�t�t|ttf�rtd��t	|g|j
���|S)NzIThe implementer_only decorator is not supported for methods or functions.)rZrr�
ValueErrorr�r1r$s  rr%zimplementer_only.__call__�s@���b�<��4�5��C�D�
D�	�B�1����1��	rN�r&r'r(rhr!r%r)rrr�r��s��
�.%�
rr�c�0�eZdZdZd�ZdZd�Zd�ZdZd�Zy)	�Providesz�Implement ``__provides__``, the instance-specific specification

    When an object is pickled, we pickle the interfaces that it implements.
    c�t�|f|z|_||_tj|g|j	||����yr)�_Provides__args�_clsr+r!rV)r rSr1s   rr!zProvides.__init__�s7���g�
�*�����	����T�Q�D�$?�$?�
�C�$P�Qrr)c�T�d}|jtur|jrd}|jdd}nd}|jf|jz}|j|�}|r6|j}t
|�dk(rd|dz}dj|�|z}dj||�S)	N�directlyProvidesTrFzsys.modules[%r]rz{}, z{}({}))r�r�_v_module_namesr�rwrg�lenr�)r �
function_name�providing_on_moduler1rb�	mod_namess      rr�zProvides.__repr__�s���+�
��9�9�
�"�t�';�';�"&�����Q�R��J�"'���)�)�����6�J��5�5�j�A�
���,�,�I��9�~��"�-�	�!��<�	��
�
�i�(���M������
�	
rc�&�t|jfSr)r�r�r6s rrtzProvides.__reduce__�s������$�$rzzope.interfacec�<�|�||jur|Std��)zHMake sure that a class __provides__ doesn't leak to an instance
        r�)r�r��r r�rSs   r�__get__zProvides.__get__s&���<�C�4�9�9�,��K��^�,�,rN)	r&r'r(rhr!r�r�rtr�r)rrr�r��s+���
R��O�
�@%�
"�J�	-rr�c�V�tj|�}|�t|�}|t|<|S)aYDeclaration for an instance of *cls*.

       The correct signature is ``cls, *interfaces``.
       The *cls* is necessary to avoid the
       construction of inconsistent resolution orders.

      Instance declarations are shared among instances that have the same
      declaration. The declarations are cached in a weak value dictionary.
    )�InstanceDeclarationsr��
ProvidesClass)r1r�s  rr�r�s3�� �#�#�J�/�D��|��j�)��+/��Z�(��KrTc��t|dd�}|�*t|dd�|urt|t�std��t	|�}|�t|�}t|t�rt
||g|���|_yt|g|���x}|_t|t�r.t|d�r!|xj|jfz
c_yyy)aYDeclare interfaces declared directly for an object

      The arguments after the object are one or more interfaces or interface
      specifications (`~zope.interface.interfaces.IDeclaration` objects).

      The interfaces given (including the interfaces in the specifications)
      replace interfaces previously declared for the object.
    r�NzHAttempt to make an interface declaration on a non-descriptor-aware classr&)
r�rZr\ryr-�
issubclassr�r�r�rr�r�r&)rpr1rS�providess    rr�r�+s����&�+�t�
,�C�
��7�3��T�:�c�A��&�$�'��9�:�
:� �
�+�J�
�{��6�l���#�t��,�F�C�E�*�E���)1�#�)C�
�)C�C��6�&��c�:�&�7�6�:�+F��$�$����(:�:�$�,G�&rc�0�t|t|�g|���y)aZDeclare interfaces declared directly for an object

    The arguments after the object are one or more interfaces or interface
    specifications (`~zope.interface.interfaces.IDeclaration` objects).

    The interfaces given (including the interfaces in the specifications) are
    added to the interfaces previously declared for the object.
    N)r��directlyProvidedBy)rpr1s  r�alsoProvidesr�Ms���V�/��7�E�*�Erc�l�t|t|�|z
�|j|�rtd��y)z; Removes a directly provided interface from an object.
    z-Can only remove directly provided interfaces.N)r�r��
providedByr�)rpr2s  r�noLongerProvidesr�Ys8���V�/��7�)�C�D����F�#��H�I�I�$rc��eZdZdZd�Zy)�ClassProvidesBase)r��_implementsc�T�||jur|�|S|jStd��)Nr�)r�r�r�r�s   rr�zClassProvidesBase.__get__is5���$�)�)���|����#�#�#��^�,�,rN)r&r'r(rir�r)rrr�r�as���I�

-rr�c�>�eZdZdZdZd�Zd�Zd�ZejZ	y)r�z�Special descriptor for class ``__provides__``

    The descriptor caches the implementedBy info, so that
    we can get declarations for objects without instance-specific
    interfaces a bit quicker.
    )�__argsc��||_t|�|_||f|z|_t	j
|g|j
||����yr)r�rPr��_ClassProvides__argsr+r!rV)r rS�metaclsr1s    rr!zClassProvides.__init__�sG����	�(��-����G�&��3������T�U�D�$?�$?�
�G�$T�Urc��|jf|jddz}|j|�}dj|�S)N�zdirectlyProvides({}))r�rrgr�)r r1rbs   rr�zClassProvides.__repr__�s?���i�i�]�T�[�[���_�4�
��5�5�j�A�
�%�,�,�]�;�;rc�2�|j|jfSr)r�rr6s rrtzClassProvides.__reduce__�s���~�~�t�{�{�*�*rN)
r&r'r(rhrir!r�rtr�r�r)rrr�r�ys+����I�V�
<�+� �'�'�Grr�c�|�t|dd�}|�t|t�rtSt	|j
dd�S)z�Return the interfaces directly provided by the given object

    The value returned is an `~zope.interface.interfaces.IDeclaration`.
    r�N���)r�rZr^rsr+rw)rpr�s  rr�r��sC��
�v�~�t�4�H����(�J�/��
��x�)�)�#�2�.�/�/rc��eZdZdZd�Zd�Zy)�providera�Declare interfaces provided directly by a class

      This function is called in a class definition.

      The arguments are one or more interfaces or interface specifications
      (`~zope.interface.interfaces.IDeclaration` objects).

      The given interfaces (including the interfaces in the specifications)
      are used to create the class's direct-object interface specification.
      An error will be raised if the module class has an direct interface
      specification. In other words, it is an error to call this function more
      than once in a class definition.

      Note that the given interfaces have nothing to do with the interfaces
      implemented by instances of the class.

      This function is provided for convenience. It provides a more convenient
      way to call `directlyProvides` for a class. For example::

        @provider(I1)
        class C:
            pass

      is equivalent to calling::

        directlyProvides(C, I1)

      after the class has been created.
    c��||_yrr5r�s  rr!zprovider.__init__�r�rc�2�t|g|j���|Sr)r�r1r$s  rr%zprovider.__call__�s����.�d�o�o�.��	rNr�r)rrr
r
�s���<%�rr
c��tjd�}|j}||jusd|vrt	d��d|vrt	d��ttgt|����x}|d<|xj|dfz
c_y)aDeclare interfaces provided by a module

    This function is used in a module definition.

    The arguments are one or more interfaces or interface specifications
    (`~zope.interface.interfaces.IDeclaration` objects).

    The given interfaces (including the interfaces in the specifications) are
    used to create the module's direct-object interface specification.  An
    error will be raised if the module already has an interface specification.
    In other words, it is an error to call this function more than once in a
    module definition.

    This function is provided for convenience. It provides a more convenient
    way to call directlyProvides. For example::

      moduleProvides(I1)

    is equivalent to::

      directlyProvides(sys.modules[__name__], I1)
    rr&z9moduleProvides can only be used from a module definition.r�z<moduleProvides can only be used once in a module definition.N)	�sys�	_getframe�f_locals�	f_globalsryr�rr-r�)r1�frame�locals�ps    r�moduleProvidesr�s���.
�M�M�!��E�
�^�^�F�	�e�o�o�%�:�V�+C��G�I�	I�����J�L�	L�"*�*�"G�+9�*�+E�"G�G�A��~�����&��,�.�.�rc��t||�S)zfProvide object specifications

    These combine information for the object and for it's classes.
    )r�)�directrSs  r�ObjectSpecificationrs��
�C�� � rc��	|j}|�t|t�r|S	|j}t
|�S#t$rd}Y�9wxYw#t$r	t
cYSwxYwr)r�r�rZr	r�rsrP)rr�rSs   r�getObjectSpecificationrsn����?�?�����h� 1�2��O���l�l����������������
��s �:�A�A�A�A�Ac��	t|t�rt|�S|j}	|j|S#t$rt|�cYSwxYw#t$r~	|j}n&#t$rt|j�cYcYSwxYw	|jj}n#t$r|cYcYSwxYw||urt|j�cYSY|SwxYw)a
    Return the interfaces provided by *ob*.

    If *ob* is a :class:`super` object, then only interfaces implemented
    by the remainder of the classes in the method resolution order are
    considered. Interfaces directly provided by the object underlying *ob*
    are not.
    )	rZr�rPr�r�rr0r�r�)r�r�cps   rr�r�1s���*��b�%� � ��$�$�����
!/�
	
�	�	�<
�H��O�*�%�b�)�)�*���/�	/����A���	/� ����.�.�	/��	����*�*�B���	��H�	��

��7�!����.�.��

�H�;/�sl�8�8�A�A�A�	C�A)�(C�)B�C�B�C�B'�&C�'B7�2C�6B7�7C�Cc��eZdZdZd�Zy)�ObjectSpecificationDescriptora�Implement the ``__providedBy__`` attribute

    The ``__providedBy__`` attribute computes the interfaces provided by
    an object. If an object has an ``__provides__`` attribute, that is returned.
    Otherwise, `implementedBy` the *cls* is returned.

    .. versionchanged:: 5.4.0
       Both the default (C) implementation and the Python implementation
       now let exceptions raised by accessing ``__provides__`` propagate.
       Previously, the C version ignored all exceptions.
    .. versionchanged:: 5.4.0
       The Python implementation now matches the C implementation and lets
       a ``__provides__`` of ``None`` override what the class is declared to
       implement.
    c�j�|�t|�S	|jS#t$rt|�cYSwxYw)z2Get an object specification for an object
        )rr�r�rPr�s   rr�z%ObjectSpecificationDescriptor.__get__�s?���<�)�#�.�.�	&��$�$�$���	&� ��%�%�	&�s��2�2N)r&r'r(rhr�r)rrrrns��� 	&rrc��|�g}|j}t|jvst|jvr|j	|�|S|D]}t||��|S)z�Normalize declaration arguments

    Normalization arguments might contain Declarions, tuples, or single
    interfaces.

    Anything but individual interfaces or implements specs will be expanded.
    )r�rrr^rJr-)�sequence�outputrS�vs    rr-r-�se���~���
�
�
�C�����$�
�c�k�k�(A��
�
�h��
�M��	&�A��1�f�%�	&��Mr)r)r)r)5rh�
__docformat__r�typesrrrr��zope.interface.interfacerrr	r
r�zope.interface._compatr�__all__r�rrr+rmr^r]r�rPr�r�r�r�r�r�r�r�r��WeakValueDictionaryr��__safe_for_unpickling__r�r�r�r�r�r�r
rrrr�rr-rsr�r)rr�<module>r,s����#�
�
�����.�3�6�2�A�.���')�#����t(�-�t(�nJ
�K�J
�fD/�-��D/�N
4�,�^
�V�
�V�r3�.)@�X1�&"�R�2�2�h%�%�X>-�{�>-�@�
�3�w�2�2�4���"$(�� �;�D	F�J�
�-�)�-�
�-�.%(�K�!2�%(�P0�&$�$�N1/�x!�
��
��$
�9
�
�9
�x
�&�&�
�&�>�(
�	 �� =� ?�r

Zerion Mini Shell 1.0