[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ More changes
reflecting the fact that IVocabularyTokenized is not
Gustavo Niemeyer
niemeyer at conectiva.com
Mon Oct 4 14:44:51 EDT 2004
Log message for revision 27740:
More changes reflecting the fact that IVocabularyTokenized is not
a mix-in anymore, and that getQuery() has been removed.
Changed:
U Zope3/trunk/src/zope/app/demo/itemvocabulary/__init__.py
U Zope3/trunk/src/zope/app/utility/vocabulary.py
U Zope3/trunk/src/zope/app/workflow/definition.py
-=-
Modified: Zope3/trunk/src/zope/app/demo/itemvocabulary/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/demo/itemvocabulary/__init__.py 2004-10-04 17:52:39 UTC (rev 27739)
+++ Zope3/trunk/src/zope/app/demo/itemvocabulary/__init__.py 2004-10-04 18:44:50 UTC (rev 27740)
@@ -21,8 +21,7 @@
__docformat__ = 'restructuredtext'
from zope.interface import implements
-from zope.schema.interfaces import \
- ITokenizedTerm, IVocabulary, IVocabularyTokenized
+from zope.schema.interfaces import ITokenizedTerm, IVocabularyTokenized
from zope.interface.common.mapping import IEnumerableMapping
@@ -49,8 +48,6 @@
3
>>> 'c' in vocab
True
- >>> vocab.getQuery() is None
- True
>>> vocab.getTerm('b').value
'b'
>>> vocab.getTerm('d')
@@ -64,7 +61,7 @@
...
LookupError: d
"""
- implements(IVocabulary, IVocabularyTokenized)
+ implements(IVocabularyTokenized)
__used_for__ = IEnumerableMapping
def __init__(self, context):
@@ -82,10 +79,6 @@
"""See zope.schema.interfaces.IBaseVocabulary"""
return value in self.context.keys()
- def getQuery(self):
- """See zope.schema.interfaces.IBaseVocabulary"""
- return None
-
def getTerm(self, value):
"""See zope.schema.interfaces.IBaseVocabulary"""
if value not in self.context.keys():
Modified: Zope3/trunk/src/zope/app/utility/vocabulary.py
===================================================================
--- Zope3/trunk/src/zope/app/utility/vocabulary.py 2004-10-04 17:52:39 UTC (rev 27739)
+++ Zope3/trunk/src/zope/app/utility/vocabulary.py 2004-10-04 18:44:50 UTC (rev 27740)
@@ -173,7 +173,7 @@
[u'object1', u'object2', u'object3']
"""
- implements(IVocabulary, IVocabularyTokenized)
+ implements(IVocabularyTokenized)
def __init__(self, context, interface, nameOnly=False):
if nameOnly is not False:
@@ -320,15 +320,11 @@
>>> term2.value
u''
- There is no special query support for `UtilityNames`:
-
- >>> vocab.getQuery()
-
>>> placelesssetup.tearDown()
"""
- implements(IVocabulary, IVocabularyTokenized)
+ implements(IVocabularyTokenized)
def __init__(self, interface):
self.interface = interface
@@ -336,9 +332,6 @@
def __contains__(self, value):
return zapi.queryUtility(self.interface, value) is not None
- def getQuery(self):
- return None
-
def getTerm(self, value):
if value in self:
return UtilityNameTerm(value)
Modified: Zope3/trunk/src/zope/app/workflow/definition.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/definition.py 2004-10-04 17:52:39 UTC (rev 27739)
+++ Zope3/trunk/src/zope/app/workflow/definition.py 2004-10-04 18:44:50 UTC (rev 27740)
@@ -21,7 +21,7 @@
from zope.interface import implements
from zope.schema.interfaces import ITokenizedTerm
-from zope.schema.interfaces import IVocabulary, IVocabularyTokenized
+from zope.schema.interfaces import IVocabularyTokenized
from zope.app import zapi
from zope.app.container.contained import Contained, setitem, uncontained
@@ -107,7 +107,7 @@
class ProcessDefinitionVocabulary(object):
"""Vocabulary providing available process definition names."""
- implements(IVocabulary, IVocabularyTokenized)
+ implements(IVocabularyTokenized)
def __init__(self, context):
self.utilities = zapi.getService(Utilities, context)
@@ -129,10 +129,6 @@
"""See zope.schema.interfaces.IVocabulary"""
return len(self.__names())
- def getQuery(self):
- """See zope.schema.interfaces.IVocabulary"""
- return None
-
def getTerm(self, value):
"""See zope.schema.interfaces.IVocabulary"""
return ProcessDefinitionTerm(value)
More information about the Zope3-Checkins
mailing list