Changeset 1539 in products


Ignore:
Timestamp:
Jan 6, 2010 1:22:30 PM (10 years ago)
Author:
mylan
Message:

Restrict export interfaces by object to directly provided only

Location:
quintagroup.transmogrifier/trunk/quintagroup/transmogrifier
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/interfacemanager.py

    r1486 r1539  
    33 
    44from zope.interface import classProvides, implements 
    5 from zope.interface import providedBy, alsoProvides 
     5from zope.interface import directlyProvidedBy, alsoProvides 
    66from zope.annotation.interfaces import IAnnotations 
    77 
     
    6464        root = doc.createElement('interfaces') 
    6565 
    66         ifaces = [i.__identifier__ for i in providedBy(obj)] 
     66        ifaces = [i.__identifier__ for i in directlyProvidedBy(obj)] 
    6767        if self.include: 
    6868            ifaces = filter(lambda i: i in self.include, ifaces) 
  • quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/interfacemanager.txt

    r1478 r1539  
    2424into consideration. If both options is absent - all interfaces will be 
    2525serialized and/or migrated. 
    26  
     26Exporter section exports only Interfaces directly provided by object, so in such 
     27way we prevent confusion with interfaces, implemented by class itself. 
    2728 
    2829>>> import pprint 
     
    7172  </record> 
    7273  <record> 
    73     Products.Archetypes.interfaces._base.IBaseObject 
     74    zope.interface.Interface 
    7475  </record> 
    7576</interfaces> 
  • quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/tests.py

    r1486 r1539  
    969969    sectionsSetUp(test) 
    970970 
     971    from zope.interface import Interface 
    971972    from zope.annotation.interfaces import IAttributeAnnotatable 
    972973    from zope.interface import alsoProvides as orig_alsoProvides 
     
    976977 
    977978        implements( 
    978             IAttributeAnnotatable, 
    979979            IBaseObject, 
    980980        ) 
     
    10061006 
    10071007    portal = MockPortal() 
     1008    orig_alsoProvides(portal, IAttributeAnnotatable, Interface) 
    10081009    test.globs['plone'] = portal 
    10091010    test.globs['transmogrifier'].context = test.globs['plone'] 
Note: See TracChangeset for help on using the changeset viewer.