[Zope3-checkins] CVS: Zope3/src/zope/interface - interface.py:1.16
interfaces.py:1.18
Jim Fulton
cvs-admin at zope.org
Mon Dec 1 11:19:33 EST 2003
Update of /cvs-repository/Zope3/src/zope/interface
In directory cvs.zope.org:/tmp/cvs-serv11346/src/zope/interface
Modified Files:
interface.py interfaces.py
Log Message:
Added a queryTaggedValue method.
=== Zope3/src/zope/interface/interface.py 1.15 => 1.16 ===
--- Zope3/src/zope/interface/interface.py:1.15 Fri Nov 21 12:11:43 2003
+++ Zope3/src/zope/interface/interface.py Mon Dec 1 11:19:33 2003
@@ -56,6 +56,10 @@
""" Returns the value associated with 'tag'. """
return self.__tagged_values[tag]
+ def queryTaggedValue(self, tag, default=None):
+ """ Returns the value associated with 'tag'. """
+ return self.__tagged_values.get(tag, default)
+
def getTaggedValueTags(self):
""" Returns a list of all tags. """
return self.__tagged_values.keys()
=== Zope3/src/zope/interface/interfaces.py 1.17 => 1.18 ===
--- Zope3/src/zope/interface/interfaces.py:1.17 Fri Nov 21 12:11:43 2003
+++ Zope3/src/zope/interface/interfaces.py Mon Dec 1 11:19:33 2003
@@ -33,7 +33,16 @@
"""Returns the documentation for the object."""
def getTaggedValue(tag):
- """Returns the value associated with 'tag'."""
+ """Returns the value associated with 'tag'.
+
+ Raise a KeyErrpr of the tag isn't set
+ """
+
+ def queryTaggedValue(tag, default=None):
+ """Returns the value associated with 'tag'.
+
+ Return the default value of the tag isn't set.
+ """
def getTaggedValueTags():
"""Returns a list of all tags."""
More information about the Zope3-Checkins
mailing list