Skip to content

Commit 4c007c4

Browse files
committed
[section] Include Parent Properties in Leaf Export
1 parent c6f5617 commit 4c007c4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

odml/section.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,17 @@ def export_leaf(self):
644644
"""
645645
Export leaf, start at section. Includes section properties, not subsections.
646646
"""
647-
curr = self.parent
648-
child = self.clone(children=False, keep_id=True)
649-
650-
for prop in self.properties:
651-
child.append(prop.clone(keep_id=True))
652-
653-
par = child
647+
curr = self
648+
par = self
649+
child = self
654650

655651
while curr is not None:
656652
par = curr.clone(children=False, keep_id=True)
657-
par.append(child)
653+
if curr != self:
654+
par.append(child)
655+
if hasattr(curr, 'properties'):
656+
for prop in curr.properties:
657+
par.append(prop.clone(keep_id=True))
658658
child = par
659659
curr = curr.parent
660660

0 commit comments

Comments
 (0)