
    ~(ph                         S r SSKrSSKrSSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SS	KJr  SS
KJr  SSKJr  SSKJr  SS/r\4rSS jrS rSS jrSS jr\R                   \l         SrS rg)z!Verify interface implementations
    N)FunctionType)
MethodType)BrokenImplementation)BrokenMethodImplementation)DoesNotImplement)Invalid)MultipleInvalid)Method)fromFunction)
fromMethodverifyObjectverifyClassc                    US:X  a  U R                   nOU R                  n/ nU(       d'  U" U5      (       d  UR                  [        X5      5        U R	                  SS9 H  u  pg [        XXqU5        M     U(       a   [        U5      S:X  a  US   e[        XU5      eg! [         a  nUR                  U5         SnAM`  SnAff = f)aH  
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es	            H/var/www/html/venv/lib/python3.13/site-packages/zope/interface/verify.py_verifyr#   )   s    B |$$!!DVI..$U6700T0:
	E%@ ; t9>q'Me55  	KKNN	s   %B
C(B??Cc                     [        X15      n[        U[        5      (       d  g [
        R                  " U5      (       d  [
        R                  " U5      (       a  g [        U[        5      (       a2  [        U[        5      (       a  US:X  a  [        XPUSS9nO[        XPUS9nOz[        U[        5      (       a)  [        UR                  5      [        L a  [        XPU5      nO<[        U[        5      (       a  US:X  a  g [        U5      (       d  [!        USUU U5      eg [#        UR%                  5       UR%                  5       5      nU(       a  [!        X'XPU5      eg ! [         a*    [        U[        5      (       d  US:X  a   g [	        XU5      ef = f)Nr   r   )r   imlevel)r   zimplementation is not a method)getattrAttributeError
isinstancer
   r   inspectismethoddescriptor	isbuiltinr   typer   MethodTypes__func__r   propertycallabler   	_incompatgetSignatureInfo)r   r   r    r   r   attrmethmesss           r"   r   r   a   sg   
;y' dF##!!$''7+<+<T+B+B 	$%%i&&5C<
  $BD  $7D 	4%%T]]|+$t,	D(	#	#
 	 ~~,0  	 T**,d.C.C.EFD(T)LL M  ;4((esl  #5	::;s   E %F?Fc                     [        XUSS9$ )z>
Verify that the *candidate* might correctly provide *iface*.
r   r   r#   r   r   r   s      r"   r   r      s     5Yc::    c                     [        XUSS9$ )Nor7   r8   r9   s      r"   r   r      s    5Yc::r:   z*implementation requires too many argumentsc                     [        US   5      [        U S   5      :  a  [        $ [        US   5      [        U S   5      :  a  US   (       d  gU S   (       a  US   (       d  gU S   (       a  US   (       d  gg g )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)r>   implementeds     r"   r1   r1      s{    
 ;z"#c(:*>&?? 
[&	'#h|.D*E	E	">+h"7A	;y#9B $:r:   )FN)F)__doc__r)   systypesr   r   zope.interface.exceptionsr   r   r   r   r	   zope.interface.interfacer
   r   r   __all__r-   r#   r   r   r   rB   r1    r:   r"   <module>rK      sw     
   : @ 6 - 5 + 1 /  n5pKM\;;  <Cr:   