Commit 8ba8f551 authored by 's avatar

merged from branch

parent 20487259
...@@ -10,6 +10,7 @@ class Attribute(InterfaceBase): ...@@ -10,6 +10,7 @@ class Attribute(InterfaceBase):
""" """
self.__name__=__name__ self.__name__=__name__
self.__doc__=__doc__ or __name__ self.__doc__=__doc__ or __name__
self.__tagged_values = {}
......
Interface package change history 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 Release 0.1.1
This release includes some changes to the documentation to reflect This release includes some changes to the documentation to reflect
......
class InterfaceBase: class InterfaceBase:
__meta_data = {}
def getName(self): def getName(self):
""" Returns the name of the object. """ """ Returns the name of the object. """
return self.__name__ return self.__name__
...@@ -11,17 +9,17 @@ class InterfaceBase: ...@@ -11,17 +9,17 @@ class InterfaceBase:
""" Returns the documentation for the object. """ """ Returns the documentation for the object. """
return self.__doc__ return self.__doc__
def getData(self, key): def getTaggedValue(self, tag):
""" Returns the value associated with 'key'. """ """ Returns the value associated with 'tag'. """
return self.__meta_data[key] return self.__tagged_values[tag]
def getDataKeys(self): def getTaggedValueTags(self):
""" Returns a list of all keys. """ """ Returns a list of all tags. """
return self.__meta_data.keys() return self.__tagged_values.keys()
def setData(self, key, value): def setTaggedValue(self, tag, value):
""" Associates 'value' with 'key'. """ """ Associates 'value' with 'key'. """
self.__meta_data[key] = value self.__tagged_values[tag] = value
......
...@@ -74,7 +74,7 @@ class Method(Attribute): ...@@ -74,7 +74,7 @@ class Method(Attribute):
return info return info
def getSignatureRepr(self): def getSignatureString(self):
sig = "(" sig = "("
for v in self.positional: for v in self.positional:
sig = sig + v sig = sig + v
......
Python Interfaces - The Scarecrow Implementation 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 This document describes my implementation of the Python interfaces
scarecrow proposal. scarecrow proposal.
......
...@@ -51,6 +51,7 @@ class Interface(InterfaceBase): ...@@ -51,6 +51,7 @@ class Interface(InterfaceBase):
"Concrete attribute, %s" % k) "Concrete attribute, %s" % k)
self.__attrs = attrs self.__attrs = attrs
self.__tagged_values = {} #why?
def getBases(self): def getBases(self):
return self.__bases__ 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