Preserve layout object properties when constructing the tree

This commit is contained in:
Chris Jones 2010-02-17 20:47:33 +01:00
parent b78938a145
commit 4fcf72a5ba
1 changed files with 7 additions and 1 deletions

View File

@ -137,10 +137,16 @@ class Terminator(Borg):
del(layout[obj])
continue
if objects.has_key(layout[obj]['parent']):
# Our parent has been created
# Our parent has been created, add ourselves
childobj = {}
childobj['type'] = layout[obj]['type']
childobj['children'] = {}
# Copy over any additional object keys
for objkey in layout[obj].keys():
if not childobj.has_key(objkey):
childobj[objkey] = layout[obj][objkey]
objects[layout[obj]['parent']]['children'][obj] = childobj
objects[obj] = childobj
del(layout[obj])