Current Path : /usr/lib/python2.7/dist-packages/zope/interface/ |
Current File : //usr/lib/python2.7/dist-packages/zope/interface/verify.pyc |
ó ÔËÞKc @ 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( sW Verify interface implementations $Id: verify.py 110699 2010-04-09 08:16:17Z regebro $ 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\ } } 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 | ƒ} nZ t | t ƒ rmt | j ƒ t k rmt | | | ƒ } 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 im_funcR t callableR t getSignatureInfot _incompatt True( t ifacet candidatet tentativet vtypet testerR t desct attrt metht mess( ( s9 /usr/lib/python2.7/dist-packages/zope/interface/verify.pyt _verify s<