added removeIfEqual

This commit is contained in:
Darren Ranalli 2004-12-04 01:43:09 +00:00
parent b840ad0a05
commit d2ef6068bc

View File

@ -40,5 +40,11 @@ class BulletinBoard:
if postName in self._dict:
del self._dict[postName]
def removeIfEqual(self, postName, value):
# only remove the post if its value is a particular value
if self.has(postName):
if self.get(postName) == value:
self.remove(postName)
def __repr__(self):
return str(self._dict)