diff --git a/record.py b/record.py index 31b2ad0..9cfcdd2 100644 --- a/record.py +++ b/record.py @@ -84,6 +84,24 @@ class RecordCollection(): except KeyError: pass + def _resolveNode(self, node): + if not node.parents: + return + elif node.propagated: + return + else: + for i in node.parents: + if not node.parents[i].propagated: + self._resolveNode(node.parents[i]) + for j in node.parents[i].data: + if not j in node.data: + node.data[j] = node.parents[i].data[j] + node.propagated = True + + def _propagate(self): + for i in self.objects: + self._resolveNode(self.objects[i]) + def findEntrypoints(self): ret = [] @@ -115,21 +133,3 @@ class RecordCollection(): lines[i] += "\n" fd.writelines(lines) - - def _resolveNode(self, node): - if not node.parents: - return - elif node.propagated: - return - else: - for i in node.parents: - if not node.parents[i].propagated: - self._resolveNode(node.parents[i]) - for j in node.parents[i].data: - if not j in node.data: - node.data[j] = node.parents[i].data[j] - node.propagated = True - - def _propagate(self): - for i in self.objects: - self._resolveNode(self.objects[i])