Ë
    š”eò  ã                   óØ   — d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZmZmZ ddgZefZdd„Zd„ Zdd„Zdd„Zej                   e_         dZd„ Zy)z!Verify interface implementations
é    N)ÚFunctionType)Ú
MethodType)ÚBrokenImplementation)ÚBrokenMethodImplementation)ÚDoesNotImplement)ÚInvalid)ÚMultipleInvalid)Ú
fromMethodÚfromFunctionÚMethodÚverifyObjectÚverifyClassc                 ót  — |dk(  r| j                   }n| j                  }g }|s# ||«      s|j                  t        | |«      «       | j	                  d¬«      D ]  \  }}	 t        | ||||«       Œ |r t        |«      dk(  r|d   ‚t        | ||«      ‚y# t        $ r}|j                  |«       Y d}~ŒZd}~ww xY w)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Úes	            ú7/usr/lib/python3/dist-packages/zope/interface/verify.pyÚ_verifyr#   '   sÅ   € ð@ �‚|Ø×$Ñ$‰à×!Ñ!ˆà€DÙ™V IÔ.Ø�‰Ô$ U¨IÓ6Ô7à×0Ñ0°TÐ0Ó:ò ‰
ˆˆdð	Ü˜E 4¨¨y¸%Õ@ðñ Üˆt‹9˜Š>Ø�q‘'ˆMÜ˜e Y°Ó5Ð5àøô ò 	Ø�K‰K˜�N‰Nûð	ús   ÁBÂ	B7ÂB2Â2B7c                 óÆ  — 	 t        ||«      }t        |t        «      sy t        j                  |«      st        j                  |«      ry t        |t        «      r4t        |t        «      r|dk(  rt        || |d¬«      }nyt        || |¬«      }njt        |t        «      r)t        |j                  «      t        u rt        || |«      }n1t        |t        «      r|dk(  ry t        |«      st!        |d|| |«      ‚y t#        |j%                  «       |j%                  «       «      }|rt!        |||| |«      ‚y # t        $ r% t        |t        «      s|dk(  rY y t	        | ||«      ‚w xY w)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   ]   sV  € ð;Ü�y $Ó'ˆô �dœFÔ#àä×!Ñ! $Ô'¬7×+<Ñ+<¸TÔ+Bð 	ä�$œÔ%Ü�i¤Ô&¨5°Cª<ô
    e°$ÀÔB‰Dô    e°$Ô7‰DÜ
�Tœ;Ô
'Ü�4—=‘=Ó!¤\Ñ1Ü˜$  tÓ,‰Ü	�Dœ(Ô	#¨°ªð
 	ô ˜Œ~Ü,¨TÐ3SØ-1°5¸)óEð Eð 	ô �T×*Ñ*Ó,¨d×.CÑ.CÓ.EÓF€DÙÜ(¨¨t°T¸5À)ÓLÐLð øôs ò ;Ü˜4¤Ô(¨e°sªlñ ä" 5¨$°	Ó:Ð:ð;ús   ‚D2 Ä2E ÅE c                 ó    — t        | ||d¬«      S )zF
    Verify that the *candidate* might correctly provide *iface*.
    r   ©r   ©r#   ©r   r   r   s      r"   r   r   Ÿ   s   € ô �5˜) Y°cÔ:Ð:ó    c                 ó    — t        | ||d¬«      S )NÚor7   r8   r9   s      r"   r   r   ¥   s   € Ü�5˜) Y°cÔ:Ð:r:   z*implementation requires too many argumentsc                 ó¾   — t        |d   «      t        | d   «      kD  rt        S t        |d   «      t        | d   «      k  r|d   sy| d   r|d   sy| d   r|d   syy y )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   ¬   sy   € ô
 ˆ;�zÑ"Ó#¤c¨(°:Ñ*>Ó&?Ò?ÜÐÜ	ˆ[˜Ñ&Ó	'¬#¨h°|Ñ.DÓ*EÒ	EØ˜IÒ&Ø>Ø�Ò +¨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      ss   ðñã Û 
Ý Ý å :Ý @Ý 6Ý -Ý 5ç EÑ Eð Øð€ð ˆn€ó4òl>MóD;ó;ð —‘€Ô à<€óCr:   