Commit 9fbc3ead authored by Michel Pelletier's avatar Michel Pelletier

Moved exceptions around, renamed tagged value methods

parent 83042b50
...@@ -23,7 +23,7 @@ class BrokenImplementation(Exception): ...@@ -23,7 +23,7 @@ class BrokenImplementation(Exception):
The %(name)s attribute was not provided. The %(name)s attribute was not provided.
""" % self.__dict__ """ % self.__dict__
class BrokenMethodImplementation(Exception): class BrokenMethodImplementation(BrokenImplementation):
"""An method is not completely implemented. """An method is not completely implemented.
""" """
......
class InterfaceBase: class InterfaceBase:
__meta_data = {} __tagged_values = {}
def getName(self): def getName(self):
""" Returns the name of the object. """ """ Returns the name of the object. """
...@@ -11,17 +11,17 @@ class InterfaceBase: ...@@ -11,17 +11,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
......
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