We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6f5617 commit 4c007c4Copy full SHA for 4c007c4
odml/section.py
@@ -644,17 +644,17 @@ def export_leaf(self):
644
"""
645
Export leaf, start at section. Includes section properties, not subsections.
646
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
+ curr = self
+ par = self
+ child = self
654
655
while curr is not None:
656
par = curr.clone(children=False, keep_id=True)
657
- par.append(child)
+ if curr != self:
+ par.append(child)
+ if hasattr(curr, 'properties'):
+ for prop in curr.properties:
+ par.append(prop.clone(keep_id=True))
658
child = par
659
curr = curr.parent
660
0 commit comments