%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__/exceptions.cpython-312.pyc

�

��e�!���dZgd�ZGd�de�ZGd�de�ZGd�de�ZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�Z	Gd�de
�Zy)zInterface-specific exceptions
)�Invalid�DoesNotImplement�BrokenImplementation�BrokenMethodImplementation�MultipleInvalid�
BadImplements�InvalidInterfacec��eZdZdZy)rz A specification is violated
    N��__name__�
__module__�__qualname__�__doc__���;/usr/lib/python3/dist-packages/zope/interface/exceptions.pyrr���rrc�v�eZdZdZdZeZdZdd�Ze	d��Z
e	d��Ze	d��Ze	d	��Z
d
ZdZdZd
�Zy)�_TargetInvalid��z<Not Given>Nc�P�	|j|S#|j$r|cYSwxYw�N)�args�_NOT_GIVEN_CATCH)�self�ix�defaults   r�_get_arg_or_defaultz"_TargetInvalid._get_arg_or_default8s/��	��9�9�R�=� ���$�$�	��N�	�s��%�%c�8�|j|j�Sr)r�
_IX_INTERFACE�rs r�	interfacez_TargetInvalid.interface>s���'�'��(:�(:�;�;rc�N�|j|j|j�Sr)r�
_IX_TARGET�
_NOT_GIVENr!s r�targetz_TargetInvalid.targetBs���'�'�������I�Irc�Z�|j}||jurydj|�S)Nz	An objectzThe object {!r})r&r%�format)rr&s  r�_str_subjectz_TargetInvalid._str_subjectZs+�������T�_�_�$�� �'�'��/�/rc�(�d|jxsdzS)Nz$has failed to implement interface %sz	<Unknown>)r"r!s r�_str_descriptionz_TargetInvalid._str_descriptionas��5��N�N�)�k�
�	
rz: z	<unknown>�.c��dj|j|j|j|j|j
�S)Nz{} {}{}{}{})r(r)r+�_str_conjunction�_str_details�_str_trailerr!s r�__str__z_TargetInvalid.__str__ksB���#�#�����!�!��!�!�������
�	
rr)rrr
r r$�
IndexErrorrr%r�propertyr"r&r)r+r.r/r0r1rrrrr"s����M��J�"���J���<��<��J��J�.�0��0��
��
�
���L��L�
rrc��eZdZdZdZy)ra
    DoesNotImplement(interface[, target])

    The *target* (optional) does not implement the *interface*.

    .. versionchanged:: 5.0.0
       Add the *target* argument and attribute, and change the resulting
       string value of this object accordingly.
    z.Does not declaratively implement the interfaceN)rrr
rr/rrrrrus���D�Lrrc�X�eZdZdZej
dzZedzZed��Z	ed��Z
y)ra[
    BrokenImplementation(interface, name[, target])

    The *target* (optional) is missing the attribute *name*.

    .. versionchanged:: 5.0.0
       Add the *target* argument and attribute, and change the resulting
       string value of this object accordingly.

       The *name* can either be a simple string or a ``Attribute`` object.
    rc� �|jdS�Nr�rr!s r�namezBrokenImplementation.name�����y�y��|�rc��dt|jt�rt|j�zS|jzS)Nz!The %s attribute was not provided)�
isinstancer9�str�reprr!s rr/z!BrokenImplementation._str_details�s8��2�)�$�)�)�S�9�D����O�
�	
�?C�y�y�
�	
rN)rrr
rrr �_IX_NAMEr$r3r9r/rrrrr�sH��
��+�+�a�/�H��A��J�
�����
��
rrc�h�eZdZdZdZedzZedzZed��Zed��Z	e
d��Zed��Zy)	ra�
    BrokenMethodImplementation(method, message[, implementation, interface, target])

    The *target* (optional) has a *method* in *implementation* that violates
    its contract in a way described by *mess*.

    .. versionchanged:: 5.0.0
       Add the *interface* and *target* argument and attribute,
       and change the resulting string value of this object accordingly.

       The *method* can either be a simple string or a ``Method`` object.

    .. versionchanged:: 5.0.0
       If *implementation* is given, then the *message* will have the
       string "implementation" replaced with an short but informative
       representation of *implementation*.

    �rc� �|jdS)Nrr8r!s r�methodz!BrokenMethodImplementation.method�r:rc� �|jdSr7r8r!s r�messzBrokenMethodImplementation.mess�r:rc�B��ddl}	|j}t}	||�}	|j}|||�zS#t$r |j}|j
��fd�}Y�IwxYw#ttf$rt|�cYSwxYw#t$r|j}Y�nwxYw)Nrc����|�Srr)�sig�fs �r�<lambda>zABrokenMethodImplementation.__implementation_str.<locals>.<lambda>�s���A�s�G�r)�inspect�	signaturer=�AttributeError�
getargspec�
formatargspec�
ValueError�	TypeErrorr>r
r)�implrKrH�	formatsigr9rIs     @r�__implementation_strz/BrokenMethodImplementation.__implementation_str�s����	�	,��#�#�C��I�	��d�)�C�	!��$�$�D��i��n�$�$��'�	,��$�$�C��%�%�A�+�I�	,���I�&�	�
��:��	���	!��=�=�D�	!�s1�:�A&�B�&A#�"A#�&B�B�B�Bc�x�|j|j|j�}|j}||jur+d|vr'|j	dd�}||j|�fz}dj
t|jt�rt|j�|�S|j|�S)N�implementationz%rz)The contract of {} is violated because {})r�_IX_IMPLr%rE�replace�/_BrokenMethodImplementation__implementation_strr(r<rCr=r>)rrR�messages   rr/z'BrokenMethodImplementation._str_details�s����'�'��
�
�t���G���)�)���t���&�+;�w�+F��o�o�&6��=�G���!:�!:�4�!@� B�B�G�:�A�A�!+�D�K�K��!=�D������
�	
�CG�;�;��
�	
rN)
rrr
rrWr r$r3rCrE�staticmethodrYr/rrrrr�so���&�H��q�L�M���"�J�
���������%��%�8�

��

rrc�N��eZdZdZdZ�fd�Zed��Zed��ZdZ	dZ
�xZS)rz�
    The *target* has failed to implement the *interface* in
    multiple ways.

    The failures are described by *exceptions*, a collection of
    other `Invalid` instances.

    .. versionadded:: 5.0
    rc�:��t�|�||t|��yr)�super�__init__�tuple)rr"r&�
exceptions�	__class__s    �rr_zMultipleInvalid.__init__�s���
����F�E�*�,=�>rc� �|jdS)NrAr8r!s rrazMultipleInvalid.exceptions�r:rc�L�ddjd�|jD��zS)Nz
    c3�K�|]9}t|t�r|jj�n
t	|����;y�wr)r<rr/�stripr=)�.0�xs  r�	<genexpr>z/MultipleInvalid._str_details.<locals>.<genexpr>s7����(
��'1��N�&C�A�N�N� � �"��Q��O�(
�s�?A)�joinrar!s rr/zMultipleInvalid._str_details�s-���(�-�-�(
��_�_�(
�
�
�	
r�:�)rrr
rrr_r3rar/r.r0�
__classcell__)rbs@rrr�sJ������?������
��
����Lrrc��eZdZdZy)rz'The interface has invalid contents
    Nr
rrrrr
rrrc��eZdZdZy)rz�An implementation assertion is invalid

    because it doesn't contain an interface or a sequence of valid
    implementation assertions.
    Nr
rrrrrs��rrN)r�__all__�	ExceptionrrrrrrrrQrrrr�<module>rrsz���
���i��
P
�W�P
�fD�~�D�
�>�
�6H
��H
�V�n��B�y���I�r

Zerion Mini Shell 1.0