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