Commit 8ba8f551 authored by 's avatar

merged from branch

parent 20487259
......@@ -10,6 +10,7 @@ class Attribute(InterfaceBase):
"""
self.__name__=__name__
self.__doc__=__doc__ or __name__
self.__tagged_values = {}
......
Interface package change history
Release 0.5 (Zope 2.3b1)
Many changes to API. Added unit tests, pretty printing, verification
code, tagged data, and other stuff.
Release 0.1.1
This release includes some changes to the documentation to reflect
......
class InterfaceBase:
__meta_data = {}
def getName(self):
""" Returns the name of the object. """
return self.__name__
......@@ -11,17 +9,17 @@ class InterfaceBase:
""" Returns the documentation for the object. """
return self.__doc__
def getData(self, key):
""" Returns the value associated with 'key'. """
return self.__meta_data[key]
def getTaggedValue(self, tag):
""" Returns the value associated with 'tag'. """
return self.__tagged_values[tag]
def getDataKeys(self):
""" Returns a list of all keys. """
return self.__meta_data.keys()
def getTaggedValueTags(self):
""" Returns a list of all tags. """
return self.__tagged_values.keys()
def setData(self, key, value):
def setTaggedValue(self, tag, value):
""" Associates 'value' with 'key'. """
self.__meta_data[key] = value
self.__tagged_values[tag] = value
......
......@@ -74,7 +74,7 @@ class Method(Attribute):
return info
def getSignatureRepr(self):
def getSignatureString(self):
sig = "("
for v in self.positional:
sig = sig + v
......
Python Interfaces - The Scarecrow Implementation
*Note: This is Jim's original proposal. Up to date user docs can be found
at http://www.zope.org/Wikis/Interfaces*
This document describes my implementation of the Python interfaces
scarecrow proposal.
......
......@@ -51,6 +51,7 @@ class Interface(InterfaceBase):
"Concrete attribute, %s" % k)
self.__attrs = attrs
self.__tagged_values = {} #why?
def getBases(self):
return self.__bases__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment