HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/zope/interface/__pycache__/exceptions.cpython-38.pyc
U

$
x`�!�@s�dZdddddddgZGdd�de�ZGd	d
�d
e�ZGdd�de�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�Z	Gdd�de
�ZdS)zInterface-specific exceptions
�Invalid�DoesNotImplement�BrokenImplementation�BrokenMethodImplementation�MultipleInvalid�
BadImplements�InvalidInterfacec@seZdZdZdS)rz A specification is violated
    N��__name__�
__module__�__qualname__�__doc__�r
r
�;/usr/lib/python3/dist-packages/zope/interface/exceptions.pyrsc@sjeZdZdZdZeZdZddd�Ze	dd��Z
e	d	d
��Ze	dd��Ze	d
d��Z
dZdZdZdd�ZdS)�_TargetInvalid��z<Not Given>NcCs,z|j|WS|jk
r&|YSXdS�N)�args�_NOT_GIVEN_CATCH)�selfZix�defaultr
r
r�_get_arg_or_default8sz"_TargetInvalid._get_arg_or_defaultcCs|�|j�Sr)r�
_IX_INTERFACE�rr
r
r�	interface>sz_TargetInvalid.interfacecCs|�|j|j�Sr)r�
_IX_TARGET�
_NOT_GIVENrr
r
r�targetBsz_TargetInvalid.targetcCs|j}||jkrdSd|fS)Nz	An objectz
The object %r)rr)rrr
r
r�_str_subjectZs
z_TargetInvalid._str_subjectcCsd|jp
dS)Nz$has failed to implement interface %sz	<Unknown>)rrr
r
r�_str_descriptionas�z_TargetInvalid._str_descriptionz: z	<unknown>�.cCsd|j|j|j|j|jfS)Nz%s %s%s%s%s)rr�_str_conjunction�_str_details�_str_trailerrr
r
r�__str__ks�z_TargetInvalid.__str__)N)r	r
rrr�
IndexErrorrrr�propertyrrrrr!r"r#r$r
r
r
rr"s"




rc@seZdZdZdZdS)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)r	r
rrr"r
r
r
rrus
c@s:eZdZdZejdZedZedd��Z	edd��Z
dS)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.
    rcCs
|jdS�Nr�rrr
r
r�name�szBrokenImplementation.namecCs dt|jt�rt|j�n|jS)Nz!The %s attribute was not provided)�
isinstancer)�str�reprrr
r
rr"�s�z!BrokenImplementation._str_detailsN)r	r
rrrrZ_IX_NAMErr&r)r"r
r
r
rr�s

c@sTeZdZdZdZedZedZedd��Zedd��Z	e
dd	��Zed
d��ZdS)
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*.

    �rcCs
|jdS)Nrr(rr
r
r�method�sz!BrokenMethodImplementation.methodcCs
|jdSr'r(rr
r
r�mess�szBrokenMethodImplementation.messc	s�ddl}z|j}t}Wn,tk
rB|j}|j��fdd�}YnXz||�}Wn ttfk
rpt|�YSXz
|j	}Wntk
r�|j
}YnX|||�S)Nrcs�|�Srr
)�sig��fr
r�<lambda>��zABrokenMethodImplementation.__implementation_str.<locals>.<lambda>)�inspect�	signaturer+�AttributeError�
getargspec�
formatargspec�
ValueError�	TypeErrorr,rr	)�implr5r0Z	formatsigr)r
r1rZ__implementation_str�s"
z/BrokenMethodImplementation.__implementation_strcCsh|�|j|j�}|j}||jk	rDd|krD|�dd�}||�|�f}dt|jt�r\t	|j�n|j|fS)N�implementationz%rz)The contract of %s is violated because %s)
r�_IX_IMPLrr/�replace�/_BrokenMethodImplementation__implementation_strr*r.r+r,)rr<�messager
r
rr"�s�z'BrokenMethodImplementation._str_detailsN)
r	r
rrr>rrr&r.r/�staticmethodr@r"r
r
r
rr�s


csDeZdZdZdZ�fdd�Zedd��Zedd��Zd	Z	d
Z
�ZS)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
    r
cstt|��||t|��dSr)�superr�__init__�tuple)rrr�
exceptions��	__class__r
rrD�szMultipleInvalid.__init__cCs
|jdS)Nr-r(rr
r
rrF�szMultipleInvalid.exceptionscCsdd�dd�|jD��S)Nz
    css*|]"}t|t�r|j��nt|�VqdSr)r*rr"�stripr+)�.0�xr
r
r�	<genexpr>s�z/MultipleInvalid._str_details.<locals>.<genexpr>)�joinrFrr
r
rr"�s�zMultipleInvalid._str_details�:�)r	r
rrrrDr&rFr"r!r#�
__classcell__r
r
rGrr�s


c@seZdZdZdS)rz'The interface has invalid contents
    Nrr
r
r
rr
sc@seZdZdZdS)rz�An implementation assertion is invalid

    because it doesn't contain an interface or a sequence of valid
    implementation assertions.
    Nrr
r
r
rrsN)r�__all__�	Exceptionrrrrrrrr;rr
r
r
r�<module>s �SK!