[Zope3-checkins] SVN: Zope3/trunk/src/zope/sendmail/ Merge from 3.3 branch:

Philipp von Weitershausen philikon at philikon.de
Sat Aug 12 13:36:19 EDT 2006


Log message for revision 69432:
  Merge from 3.3 branch:
   Log message for revision 69430:
    When I converted vocabulary ZCML directives to utility ZCML directives
    + a definition of the vocabulary in Python, I must have fallen asleep
    over this one: it was missing the interface descriminator and the nameOnly
    flag. Fixed and tested.
  
  

Changed:
  A   Zope3/trunk/src/zope/sendmail/tests/test_vocabulary.py
  U   Zope3/trunk/src/zope/sendmail/vocabulary.py

-=-
Copied: Zope3/trunk/src/zope/sendmail/tests/test_vocabulary.py (from rev 69430, Zope3/branches/3.3/src/zope/sendmail/tests/test_vocabulary.py)

Modified: Zope3/trunk/src/zope/sendmail/vocabulary.py
===================================================================
--- Zope3/trunk/src/zope/sendmail/vocabulary.py	2006-08-12 17:35:32 UTC (rev 69431)
+++ Zope3/trunk/src/zope/sendmail/vocabulary.py	2006-08-12 17:36:18 UTC (rev 69432)
@@ -19,7 +19,35 @@
 
 from zope.interface import classProvides
 from zope.schema.interfaces import IVocabularyFactory
+from zope.sendmail.interfaces import IMailDelivery
 from zope.app.component.vocabulary import UtilityVocabulary
 
 class MailDeliveryNames(UtilityVocabulary):
+    """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
+    """
     classProvides(IVocabularyFactory)
+    interface = IMailDelivery
+    nameOnly = True



More information about the Zope3-Checkins mailing list