Function
zope.component.interface.getInterface

Signature

getInterface(context, id)

Documentation String

Return interface or raise ComponentLookupError

>>> from zope.interface import Interface
>>> from zope.component.tests import ITestType
>>> class I4(Interface):
...     pass
>>> IInterface.providedBy(I4)
True
>>> ITestType.providedBy(I4)
False
>>> getInterface(None, 'zope.component.interface.I4')
Traceback (most recent call last):
...
ComponentLookupError: zope.component.interface.I4
>>> provideInterface('', I4, ITestType)
>>> ITestType.providedBy(I4)
True
>>> iface = queryInterface(  'zope.component.interface.I4')
>>> iface.__name__
'I4'