�
�/Qc @ s� d Z d d l m Z m Z d d l m Z d d l m Z m Z d d l m Z m
Z
m Z d d l Z e f Z
d d d � Z d d � Z d d
� Z d � Z d S( s! Verify interface implementations
i����( t BrokenImplementationt DoesNotImplement( t BrokenMethodImplementation( t FunctionTypet
MethodType( t
fromMethodt fromFunctiont MethodNi c
C s� | d k r | j } n | j } | rD | | � rD t | � � n x�| j d � D]�\ } } y t | | � } WnB t k
r� t | t � r� | d k r� qT n t | | � � n Xt | t � s� qT n t | t � r4t
j d d k rt | t � rt
| | d | d d �} q�t
| | d | �} n{ t | t � rmt | j � t k rmt | | | � } nB t | t � r�| d k r�qT n! t | � sT t | d � � qT qT | j � } | j � } t | | � } | rT t | | � � qT qT Wt S( s� Verify that 'candidate' might correctly implements 'iface'.
This involves:
o Making sure the candidate defines all the necessary methods
o Making sure the methods have the correct signature
o Making sure the candidate asserts that it implements the interface
Note that this isn't the same as verifying that the class does
implement the interface.
If optional tentative is true, suppress the "is implemented by" test.
t ci i t 3t namet imlevels Not a method( t
implementedByt
providedByR t namesAndDescriptionst getattrt AttributeErrort
isinstanceR R R t syst versiont typeR t MethodTypest __func__R t propertyt callableR t getSignatureInfot _incompatt True(
t ifacet candidatet tentativet vtypet testerR
t desct attrt metht mess( ( s; /usr/lib64/python2.7/site-packages/zope/interface/verify.pyt _verify sB
"c C s t | | | d d �S( NR R ( R% ( R R R ( ( s; /usr/lib64/python2.7/site-packages/zope/interface/verify.pyt verifyClasse s c C s t | | | d d �S( NR t o( R% ( R R R ( ( s; /usr/lib64/python2.7/site-packages/zope/interface/verify.pyt verifyObjecth s c C s� t | d � t | d � k r$ d St | d � t | d � k rS | d rS d S| d rl | d rl d S| d r� | d r� d Sd S( Nt requireds* implementation requires too many argumentst
positionalt varargss- implementation doesn't allow enough argumentst kwargss0 implementation doesn't support keyword argumentss1 implementation doesn't support variable arguments( t len( R) t implemented( ( s; /usr/lib64/python2.7/site-packages/zope/interface/verify.pyR k s ( t __doc__t zope.interface.exceptionsR R R t typesR R t zope.interface.interfaceR R R R R t NoneR% R&