move internal methods to top
This commit is contained in:
parent
f949e18d7e
commit
9c7fdbd6e3
36
record.py
36
record.py
|
@ -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])
|
|
||||||
|
|
Loading…
Reference in New Issue