move internal methods to top

This commit is contained in:
randomuser 2021-11-23 11:20:19 -06:00
parent f949e18d7e
commit 9c7fdbd6e3
1 changed files with 18 additions and 18 deletions

View File

@ -84,6 +84,24 @@ class RecordCollection():
except KeyError: except KeyError:
pass 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): def findEntrypoints(self):
ret = [] ret = []
@ -115,21 +133,3 @@ class RecordCollection():
lines[i] += "\n" lines[i] += "\n"
fd.writelines(lines) 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])