CasperSecurity

Current Path : /lib/python3/dist-packages/zope/interface/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/zope/interface/__pycache__/verify.cpython-310.pyc

o

$
x`� �@s�dZddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZddl
mZdd	l
m
Z
dd
l
mZddl
mZddlmZmZmZd
dgZefZddd�Zdd�Zddd�Zddd
�Zeje_dZeef�Zdd�Zdd�ZdS)z!Verify interface implementations
�)�print_functionN)�FunctionType)�
MethodType)�PYPY2)�BrokenImplementation)�BrokenMethodImplementation)�DoesNotImplement)�Invalid)�MultipleInvalid)�
fromMethod�fromFunction�Method�verifyObject�verifyClassFc	Cs�|dkr|j}n|j}g}|s||�s|�t||��|jdd�D]%\}}z
t|||||�Wq!tyF}z|�|�WYd}~q!d}~ww|rYt|�dkrS|d�t|||��dS)a�
    Verify that *candidate* might correctly provide *iface*.

    This involves:

    - Making sure the candidate claims that it provides the
      interface using ``iface.providedBy`` (unless *tentative* is `True`,
      in which case this step is skipped). This means that the candidate's class
      declares that it `implements <zope.interface.implementer>` the interface,
      or the candidate itself declares that it `provides <zope.interface.provider>`
      the interface

    - Making sure the candidate defines all the necessary methods

    - Making sure the methods have the correct signature (to the
      extent possible)

    - Making sure the candidate defines all the necessary attributes

    :return bool: Returns a true value if everything that could be
       checked passed.
    :raises zope.interface.Invalid: If any of the previous
       conditions does not hold.

    .. versionchanged:: 5.0
        If multiple methods or attributes are invalid, all such errors
        are collected and reported. Previously, only the first error was reported.
        As a special case, if only one such error is present, it is raised
        alone, like before.
    �cT)�allN�r)	�
implementedBy�
providedBy�appendr�namesAndDescriptions�_verify_elementr	�lenr
)	�iface�	candidate�	tentative�vtype�tester�excs�name�desc�e�r"�7/usr/lib/python3/dist-packages/zope/interface/verify.py�_verify*s$ ��r$cCsJzt||�}Wnty t|t�s|dkrYdSt|||��wt|t�s(dSt�|�s2t�|�r4dSt|t�rZt	j
ddkrRt|t�rR|dkrRt|||dd�}n4t|||d�}n,t|t
�rmt|j�turmt|||�}nt|t�rx|dkrxdSt|�s�t|d|||��dSt|��|���}|r�tr�t|||�r�dSt|||||��dS)Nrr�r)r�imlevel)rzimplementation is not a method)�getattr�AttributeError�
isinstancer
r�inspect�ismethoddescriptor�	isbuiltinr�sys�version_info�typer�MethodTypes�__func__r�property�callabler�	_incompat�getSignatureInfor�_pypy2_false_positive)rrr rr�attr�meth�messr"r"r#r`sB�

 �
��rcC�t|||dd�S)zF
    Verify that the *candidate* might correctly provide *iface*.
    r�r�r$�rrrr"r"r#r�scCr:)N�or;r<r=r"r"r#r�sz*implementation requires too many argumentscCs<|tvrdStt���}|dkr|nt|�}||vrdSdS)NFrT)�_KNOWN_PYPY2_FALSE_POSITIVES�vars�__builtins__�valuesr/)�msgrr�known_builtin_types�candidate_typer"r"r#r6�sr6cCspt|d�t|d�krtSt|d�t|d�kr |ds dS|dr*|ds*dS|dr4|ds6dSdSdS)N�required�
positional�varargsz-implementation doesn't allow enough arguments�kwargsz0implementation doesn't support keyword argumentsz1implementation doesn't support variable arguments)r�
_MSG_TOO_MANY)rF�implementedr"r"r#r4�s��r4)FN)F)�__doc__�
__future__rr*r-�typesrr�zope.interface._compatr�zope.interface.exceptionsrrrr	r
�zope.interface.interfacerrr
�__all__r0r$rrrrJ�	frozensetr?r6r4r"r"r"r#�<module>s8
�
6
E
�
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY