zope.interface.Interface on Zope 2.12 no longer implements the deprecated...

zope.interface.Interface on Zope 2.12 no longer implements the deprecated isImplementedBy method call that got renamed already on Zope 2.8. (approved by jm)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29888 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0929aad5
...@@ -274,7 +274,7 @@ class TestPredicates(TestPredicateMixIn): ...@@ -274,7 +274,7 @@ class TestPredicates(TestPredicateMixIn):
from Products.ERP5Type.interfaces import IPredicate from Products.ERP5Type.interfaces import IPredicate
from Products.ERP5Type.Document.Predicate import Predicate from Products.ERP5Type.Document.Predicate import Predicate
predicate = self.createPredicate() predicate = self.createPredicate()
self.failUnless(IPredicate.isImplementedBy(predicate)) self.failUnless(IPredicate.providedBy(predicate))
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
verifyClass(IPredicate, Predicate) verifyClass(IPredicate, Predicate)
......
...@@ -119,7 +119,7 @@ class Transform(SimpleItem): ...@@ -119,7 +119,7 @@ class Transform(SimpleItem):
# check this is a valid transform # check this is a valid transform
if not hasattr(transform, '__class__'): if not hasattr(transform, '__class__'):
raise TransformException('Invalid transform : transform is not a class') raise TransformException('Invalid transform : transform is not a class')
if not itransform.isImplementedBy(transform): if not itransform.providedBy(transform):
raise TransformException('Invalid transform : itransform is not implemented by %s' % transform.__class__) raise TransformException('Invalid transform : itransform is not implemented by %s' % transform.__class__)
if not hasattr(transform, 'inputs'): if not hasattr(transform, 'inputs'):
raise TransformException('Invalid transform : missing required "inputs" attribute') raise TransformException('Invalid transform : missing required "inputs" attribute')
......
...@@ -183,8 +183,8 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder): ...@@ -183,8 +183,8 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder):
transform = path[0] transform = path[0]
result = transform.convert(orig, data, context=context, usedby=usedby, **kwargs) result = transform.convert(orig, data, context=context, usedby=usedby, **kwargs)
assert(idatastream.isImplementedBy(result), assert(idatastream.providedBy(result),
'result doesn\'t implemented idatastream') 'result doesn\'t is not an idatastream')
self._setMetaData(result, transform) self._setMetaData(result, transform)
# set cache if possible # set cache if possible
...@@ -254,7 +254,7 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder): ...@@ -254,7 +254,7 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder):
def _unwrap(self, data): def _unwrap(self, data):
"""unwrap data from an icache""" """unwrap data from an icache"""
if idatastream.isImplementedBy(data): if idatastream.providedBy(data):
data = data.getData() data = data.getData()
return data return data
...@@ -482,7 +482,7 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder): ...@@ -482,7 +482,7 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder):
# register non zope transform # register non zope transform
module = str(transform.__module__) module = str(transform.__module__)
transform = Transform(transform.name(), module, transform) transform = Transform(transform.name(), module, transform)
if not itransform.isImplementedBy(transform): if not itransform.providedBy(transform):
raise TransformException('%s does not implement itransform' % transform) raise TransformException('%s does not implement itransform' % transform)
name = transform.name() name = transform.name()
__traceback_info__ = (name, transform) __traceback_info__ = (name, transform)
......
...@@ -40,7 +40,7 @@ class TransformTest(ATSiteTestCase): ...@@ -40,7 +40,7 @@ class TransformTest(ATSiteTestCase):
input.close() input.close()
data = datastream(self.transform.name()) data = datastream(self.transform.name())
res_data = self.transform.convert(orig, data, filename=filename) res_data = self.transform.convert(orig, data, filename=filename)
self.assert_(idatastream.isImplementedBy(res_data)) self.assert_(idatastream.providedBy(res_data))
got = res_data.getData() got = res_data.getData()
try: try:
output = open(output) output = open(output)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment