diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-01-18 18:40:43 +0000 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-01-19 12:07:46 +0000 |
commit | 749948736178b7df4e8c52a3dddf16f83359dcfc (patch) | |
tree | abe1b191ca0a18d4976ec59896ca60bddb65febd /morphlib/blobs.py | |
parent | 85069b20d623b93154fb3858eaae0e978fd6a2e6 (diff) | |
download | morph-749948736178b7df4e8c52a3dddf16f83359dcfc.tar.gz |
Apply code review changes and fix a bug when clearing dependencies.
Diffstat (limited to 'morphlib/blobs.py')
-rw-r--r-- | morphlib/blobs.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/morphlib/blobs.py b/morphlib/blobs.py index 70cd1f90..6ddcaf0c 100644 --- a/morphlib/blobs.py +++ b/morphlib/blobs.py @@ -16,15 +16,18 @@ class Blob(object): - def __init__(self, parent, morph): - self.parent = parent + def __init__(self, morph): + self.parents = [] self.morph = morph - self.dependencies = set() - self.dependents = set() + self.dependencies = [] + self.dependents = [] + + def add_parent(self, parent): + self.parents.append(parent) def add_dependency(self, other): - self.dependencies.add(other) - other.dependents.add(self) + self.dependencies.append(other) + other.dependents.append(self) def remove_dependency(self, other): self.dependencies.remove(other) |