Vocabulary with names of mail delivery utilities
Let's provide a few stub utilities:
>>> from zope.interface import implements >>> class StubMailDelivery(object): ... implements(IMailDelivery)>>> from zope.component import provideUtility >>> for name in 'and now for something completely different'.split(): ... provideUtility(StubMailDelivery(), name=name)
Let's also provide another utility to verify that we only see mail delivery utilities:
>>> provideUtility(MailDeliveryNames, name='Mail Delivery Names')
Let's see what's in the vocabulary:
>>> vocabulary = MailDeliveryNames(None) >>> names = [term.value for term in vocabulary] >>> names.sort() >>> print ' '.join(names) and completely different for now something
interface
(type:
InterfaceClass
)
<InterfaceClass zope.sendmail.interfaces.IMailDelivery>
nameOnly
(type:
bool
)
True
getTerm(value)
See zope.schema.interfaces.IBaseVocabulary
getTermByToken(token)
See zope.schema.interfaces.IVocabularyTokenized
There are no known subclasses.