File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -668,14 +668,21 @@ def export_leaf(self):
668
668
"""
669
669
Export leaf, start at property.
670
670
"""
671
- orig = self .parent
672
- child = self .clone (keep_id = True )
673
- par = child
674
-
675
- while orig is not None :
676
- par = orig .clone (children = False , keep_id = True )
677
- par .append (child )
671
+ curr = self .parent
672
+ par = self .parent
673
+ child = self .parent
674
+
675
+ while curr is not None :
676
+ par = curr .clone (children = False , keep_id = True )
677
+ if curr != self .parent :
678
+ par .append (child )
679
+ if hasattr (curr , 'properties' ):
680
+ if curr == self .parent :
681
+ par .append (self .clone (keep_id = True ))
682
+ else :
683
+ for prop in curr .properties :
684
+ par .append (prop .clone (keep_id = True ))
678
685
child = par
679
- orig = orig .parent
686
+ curr = curr .parent
680
687
681
- return par
688
+ return par
You can’t perform that action at this time.
0 commit comments